diff --git a/src/fetcher.rs b/src/archive/fetcher.rs similarity index 98% rename from src/fetcher.rs rename to src/archive/fetcher.rs index 1ddbdd4..4a3aff0 100644 --- a/src/fetcher.rs +++ b/src/archive/fetcher.rs @@ -9,8 +9,8 @@ use zip::read::ZipArchive; use zip::result::ZipError; use crate::error::{Error, Result}; -use crate::parser::parse; -use crate::story::Story; +use super::parser::parse; +use super::story::Story; pub struct Fetcher where diff --git a/src/archive/mod.rs b/src/archive/mod.rs new file mode 100644 index 0000000..1216681 --- /dev/null +++ b/src/archive/mod.rs @@ -0,0 +1,8 @@ +//! Archive module. + +mod fetcher; +mod parser; +mod story; + +pub use fetcher::*; +pub use story::*; diff --git a/src/parser.rs b/src/archive/parser.rs similarity index 99% rename from src/parser.rs rename to src/archive/parser.rs index 99a6867..162ee21 100644 --- a/src/parser.rs +++ b/src/archive/parser.rs @@ -7,7 +7,7 @@ use std::thread::spawn; use serde_json::from_str; use crate::error::{Error, Result}; -use crate::story::Story; +use super::story::Story; const TRIM: &[char] = &['"', ',', ' ', '\t', '\n', '\r']; diff --git a/src/story.rs b/src/archive/story.rs similarity index 100% rename from src/story.rs rename to src/archive/story.rs diff --git a/src/main.rs b/src/main.rs index 0c8fedf..f95f08d 100644 --- a/src/main.rs +++ b/src/main.rs @@ -1,15 +1,13 @@ //! Main module. +pub mod archive; pub mod error; -pub mod fetcher; -pub mod parser; -pub mod story; use std::env::args; use std::time::Instant; +use crate::archive::Fetcher; use crate::error::{Error, Result}; -use crate::fetcher::Fetcher; fn main() -> Result<()> { use Error::*;