diff --git a/src/index/item.rs b/src/index/item.rs index 83d221d..92d9209 100644 --- a/src/index/item.rs +++ b/src/index/item.rs @@ -1,7 +1,7 @@ use serde::{Deserialize, Serialize}; -use crate::repository::ItemId; -use crate::{repository_item::RepositoryItem, version::Version}; +use crate::repository::{item::RepositoryItem, ItemId}; +use crate::version::Version; #[derive(Clone, Debug, PartialOrd, PartialEq, Ord, Eq, Serialize, Deserialize)] pub struct IndexItem { diff --git a/src/index/mod.rs b/src/index/mod.rs index 0a44ec2..a1e8600 100644 --- a/src/index/mod.rs +++ b/src/index/mod.rs @@ -5,8 +5,8 @@ use std::path::Path; use serde::{Deserialize, Serialize}; use crate::index::item::IndexItem; -use crate::repository::ItemId; -use crate::{repository_item::RepositoryItem, version::Version}; +use crate::repository::{item::RepositoryItem, ItemId}; +use crate::version::Version; use anyhow::Result; use anyhow::*; diff --git a/src/lib.rs b/src/lib.rs index f88bb6d..583ea1e 100644 --- a/src/lib.rs +++ b/src/lib.rs @@ -1,10 +1,7 @@ pub mod backup; pub mod repository; pub mod restore; -pub mod source; - pub mod test; mod index; -mod repository_item; mod version; diff --git a/src/repository_item.rs b/src/repository/item.rs similarity index 100% rename from src/repository_item.rs rename to src/repository/item.rs diff --git a/src/repository.rs b/src/repository/mod.rs similarity index 99% rename from src/repository.rs rename to src/repository/mod.rs index d7ae664..c1eeced 100644 --- a/src/repository.rs +++ b/src/repository/mod.rs @@ -1,3 +1,5 @@ +pub mod item; + use std::fmt::Formatter; use std::fs::File; use std::io::BufReader; @@ -5,9 +7,9 @@ use std::path::{Path, PathBuf}; use std::{fmt, fs, io}; use crate::index::{Index, IndexItemIterator}; -use crate::repository_item::RepositoryItem; use anyhow::Result; use anyhow::*; +use item::RepositoryItem; use serde::{Deserialize, Serialize}; use sha2::Digest; use sha2::Sha512; diff --git a/src/restore.rs b/src/restore.rs index aac7551..885c736 100644 --- a/src/restore.rs +++ b/src/restore.rs @@ -1,7 +1,6 @@ use std::path::Path; -use crate::repository::Repository; -use crate::repository_item::RepositoryItem; +use crate::repository::{item::RepositoryItem, Repository}; use anyhow::Result; use anyhow::*; diff --git a/src/test/assertions.rs b/src/test/assertions.rs index 27fbdf4..31c3e20 100644 --- a/src/test/assertions.rs +++ b/src/test/assertions.rs @@ -5,9 +5,8 @@ use std::path::Path; use tempfile::tempdir; use walkdir::WalkDir; -use crate::repository::{ItemId, Repository}; -use crate::repository_item::RepositoryItem; -use crate::source::TempSource; +use super::source::TempSource; +use crate::repository::{item::RepositoryItem, ItemId, Repository}; use crate::{backup, restore}; use anyhow::Result; diff --git a/src/test/mod.rs b/src/test/mod.rs index 5324bda..57ce3ea 100644 --- a/src/test/mod.rs +++ b/src/test/mod.rs @@ -1 +1,2 @@ pub mod assertions; +pub mod source; diff --git a/src/source.rs b/src/test/source.rs similarity index 100% rename from src/source.rs rename to src/test/source.rs diff --git a/tests/concurrency_tests.rs b/tests/concurrency_tests.rs index 7ff6bde..1a35c94 100644 --- a/tests/concurrency_tests.rs +++ b/tests/concurrency_tests.rs @@ -4,8 +4,7 @@ use std::path::Path; use anyhow::Result; use async_log::span; use bakare::repository::Repository; -use bakare::source::TempSource; -use bakare::test::assertions::*; +use bakare::test::{assertions::*, source::TempSource}; use bakare::{backup, restore}; use nix::sys::wait::{waitpid, WaitStatus}; use nix::unistd::{fork, getpid, ForkResult}; diff --git a/tests/system_tests.rs b/tests/system_tests.rs index fc9a2a3..ebe278a 100644 --- a/tests/system_tests.rs +++ b/tests/system_tests.rs @@ -3,8 +3,7 @@ use tempfile::tempdir; use anyhow::Result; use bakare::backup; use bakare::repository::Repository; -use bakare::source::TempSource; -use bakare::test::assertions::*; +use bakare::test::{assertions::*, source::TempSource}; #[test] fn restore_multiple_files() -> Result<()> {