make git origin store types private

This commit is contained in:
Brian Picciano 2023-05-11 14:31:48 +02:00
parent 386b02023c
commit 742523d0a0
2 changed files with 7 additions and 7 deletions

View File

@ -99,7 +99,7 @@ mod tests {
fn basic() { fn basic() {
let tmp_dir = TempDir::new("domain_config_store").unwrap(); let tmp_dir = TempDir::new("domain_config_store").unwrap();
let store = new_store(tmp_dir.path()).expect("store created"); let store = new(tmp_dir.path()).expect("store created");
let domain = "foo"; let domain = "foo";

View File

@ -5,7 +5,7 @@ use std::error::Error;
use std::path::{Path, PathBuf}; use std::path::{Path, PathBuf};
use std::{collections, fs, io, sync}; use std::{collections, fs, io, sync};
pub struct Origin { struct Origin {
descr: origin::Descr, descr: origin::Descr,
repo: gix::ThreadSafeRepository, repo: gix::ThreadSafeRepository,
tree_object_id: gix::ObjectId, tree_object_id: gix::ObjectId,
@ -55,7 +55,7 @@ enum GetOriginError {
/// git::Store implements the Store trait for any Descr::Git based Origins. If any non-git /// git::Store implements the Store trait for any Descr::Git based Origins. If any non-git
/// Descrs are used then this implementation will panic. /// Descrs are used then this implementation will panic.
pub struct Store { struct Store {
dir_path: PathBuf, dir_path: PathBuf,
// to prevent against syncing the same origin more than once at a time, but still allowing // to prevent against syncing the same origin more than once at a time, but still allowing
@ -312,7 +312,6 @@ mod tests {
use crate::origin::store; use crate::origin::store;
use crate::origin::store::Store; use crate::origin::store::Store;
use crate::origin::{self, Origin}; use crate::origin::{self, Origin};
use std::sync;
use tempdir::TempDir; use tempdir::TempDir;
#[test] #[test]
@ -333,7 +332,7 @@ mod tests {
let limits = store::Limits {}; let limits = store::Limits {};
let store = super::Store::new(tmp_dir.path().to_path_buf()).expect("store created"); let store = super::new(tmp_dir.path().to_path_buf()).expect("store created");
store store
.sync(descr.clone(), limits) .sync(descr.clone(), limits)
@ -344,7 +343,7 @@ mod tests {
assert!(matches!( assert!(matches!(
store.get(other_descr), store.get(other_descr),
Err::<sync::Arc<super::Origin>, store::GetError>(store::GetError::NotFound), Err::<_, store::GetError>(store::GetError::NotFound),
)); ));
let origin = store.get(descr.clone()).expect("origin retrieved"); let origin = store.get(descr.clone()).expect("origin retrieved");
@ -372,7 +371,8 @@ mod tests {
let descrs = store let descrs = store
.all_descrs() .all_descrs()
.expect("all_descrs callsed") .expect("all_descrs called")
.into_iter()
.collect::<Vec<Result<origin::Descr, store::AllDescrsError>>>(); .collect::<Vec<Result<origin::Descr, store::AllDescrsError>>>();
assert_eq!(1, descrs.len()); assert_eq!(1, descrs.len());