Cleanup top level modules

This commit is contained in:
Cyryl Płotnicki 2020-11-08 20:02:26 +00:00
parent d187421a0b
commit 8da325341b
11 changed files with 13 additions and 17 deletions

View file

@ -1,7 +1,7 @@
use serde::{Deserialize, Serialize}; use serde::{Deserialize, Serialize};
use crate::repository::ItemId; use crate::repository::{item::RepositoryItem, ItemId};
use crate::{repository_item::RepositoryItem, version::Version}; use crate::version::Version;
#[derive(Clone, Debug, PartialOrd, PartialEq, Ord, Eq, Serialize, Deserialize)] #[derive(Clone, Debug, PartialOrd, PartialEq, Ord, Eq, Serialize, Deserialize)]
pub struct IndexItem { pub struct IndexItem {

View file

@ -5,8 +5,8 @@ use std::path::Path;
use serde::{Deserialize, Serialize}; use serde::{Deserialize, Serialize};
use crate::index::item::IndexItem; use crate::index::item::IndexItem;
use crate::repository::ItemId; use crate::repository::{item::RepositoryItem, ItemId};
use crate::{repository_item::RepositoryItem, version::Version}; use crate::version::Version;
use anyhow::Result; use anyhow::Result;
use anyhow::*; use anyhow::*;

View file

@ -1,10 +1,7 @@
pub mod backup; pub mod backup;
pub mod repository; pub mod repository;
pub mod restore; pub mod restore;
pub mod source;
pub mod test; pub mod test;
mod index; mod index;
mod repository_item;
mod version; mod version;

View file

@ -1,3 +1,5 @@
pub mod item;
use std::fmt::Formatter; use std::fmt::Formatter;
use std::fs::File; use std::fs::File;
use std::io::BufReader; use std::io::BufReader;
@ -5,9 +7,9 @@ use std::path::{Path, PathBuf};
use std::{fmt, fs, io}; use std::{fmt, fs, io};
use crate::index::{Index, IndexItemIterator}; use crate::index::{Index, IndexItemIterator};
use crate::repository_item::RepositoryItem;
use anyhow::Result; use anyhow::Result;
use anyhow::*; use anyhow::*;
use item::RepositoryItem;
use serde::{Deserialize, Serialize}; use serde::{Deserialize, Serialize};
use sha2::Digest; use sha2::Digest;
use sha2::Sha512; use sha2::Sha512;

View file

@ -1,7 +1,6 @@
use std::path::Path; use std::path::Path;
use crate::repository::Repository; use crate::repository::{item::RepositoryItem, Repository};
use crate::repository_item::RepositoryItem;
use anyhow::Result; use anyhow::Result;
use anyhow::*; use anyhow::*;

View file

@ -5,9 +5,8 @@ use std::path::Path;
use tempfile::tempdir; use tempfile::tempdir;
use walkdir::WalkDir; use walkdir::WalkDir;
use crate::repository::{ItemId, Repository}; use super::source::TempSource;
use crate::repository_item::RepositoryItem; use crate::repository::{item::RepositoryItem, ItemId, Repository};
use crate::source::TempSource;
use crate::{backup, restore}; use crate::{backup, restore};
use anyhow::Result; use anyhow::Result;

View file

@ -1 +1,2 @@
pub mod assertions; pub mod assertions;
pub mod source;

View file

@ -4,8 +4,7 @@ use std::path::Path;
use anyhow::Result; use anyhow::Result;
use async_log::span; use async_log::span;
use bakare::repository::Repository; use bakare::repository::Repository;
use bakare::source::TempSource; use bakare::test::{assertions::*, source::TempSource};
use bakare::test::assertions::*;
use bakare::{backup, restore}; use bakare::{backup, restore};
use nix::sys::wait::{waitpid, WaitStatus}; use nix::sys::wait::{waitpid, WaitStatus};
use nix::unistd::{fork, getpid, ForkResult}; use nix::unistd::{fork, getpid, ForkResult};

View file

@ -3,8 +3,7 @@ use tempfile::tempdir;
use anyhow::Result; use anyhow::Result;
use bakare::backup; use bakare::backup;
use bakare::repository::Repository; use bakare::repository::Repository;
use bakare::source::TempSource; use bakare::test::{assertions::*, source::TempSource};
use bakare::test::assertions::*;
#[test] #[test]
fn restore_multiple_files() -> Result<()> { fn restore_multiple_files() -> Result<()> {