From 742523d0a081d37bd4650293254f58cc069c7ce6 Mon Sep 17 00:00:00 2001 From: Brian Picciano Date: Thu, 11 May 2023 14:31:48 +0200 Subject: [PATCH] make git origin store types private --- src/domain/config.rs | 2 +- src/origin/store/git.rs | 12 ++++++------ 2 files changed, 7 insertions(+), 7 deletions(-) diff --git a/src/domain/config.rs b/src/domain/config.rs index 149af66..a66106c 100644 --- a/src/domain/config.rs +++ b/src/domain/config.rs @@ -99,7 +99,7 @@ mod tests { fn basic() { 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"; diff --git a/src/origin/store/git.rs b/src/origin/store/git.rs index 14f95c3..f9f8d54 100644 --- a/src/origin/store/git.rs +++ b/src/origin/store/git.rs @@ -5,7 +5,7 @@ use std::error::Error; use std::path::{Path, PathBuf}; use std::{collections, fs, io, sync}; -pub struct Origin { +struct Origin { descr: origin::Descr, repo: gix::ThreadSafeRepository, 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 /// Descrs are used then this implementation will panic. -pub struct Store { +struct Store { dir_path: PathBuf, // 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::Store; use crate::origin::{self, Origin}; - use std::sync; use tempdir::TempDir; #[test] @@ -333,7 +332,7 @@ mod tests { 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 .sync(descr.clone(), limits) @@ -344,7 +343,7 @@ mod tests { assert!(matches!( store.get(other_descr), - Err::, store::GetError>(store::GetError::NotFound), + Err::<_, store::GetError>(store::GetError::NotFound), )); let origin = store.get(descr.clone()).expect("origin retrieved"); @@ -372,7 +371,8 @@ mod tests { let descrs = store .all_descrs() - .expect("all_descrs callsed") + .expect("all_descrs called") + .into_iter() .collect::>>(); assert_eq!(1, descrs.len());