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() {
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";

View File

@ -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::<sync::Arc<super::Origin>, 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::<Vec<Result<origin::Descr, store::AllDescrsError>>>();
assert_eq!(1, descrs.len());