diff --git a/src/file.rs b/src/file/env.rs similarity index 100% rename from src/file.rs rename to src/file/env.rs diff --git a/src/file/mod.rs b/src/file/mod.rs new file mode 100644 index 0000000..3a55a73 --- /dev/null +++ b/src/file/mod.rs @@ -0,0 +1,4 @@ +mod env; +pub mod read; + +pub use env::FileEnv; diff --git a/src/subscriptions.rs b/src/file/read.rs similarity index 88% rename from src/subscriptions.rs rename to src/file/read.rs index edaf777..2bb892f 100644 --- a/src/subscriptions.rs +++ b/src/file/read.rs @@ -27,7 +27,7 @@ mod tests { //given let (dir, file_name) = create_text_file( "subscriptions.txt", - include_bytes!("../test/data/subscriptions.txt"), + include_bytes!("../../test/data/subscriptions.txt"), )?; let file_env = FileEnv::default(); @@ -45,7 +45,7 @@ mod tests { //given let (dir, file_name) = create_text_file( "subscriptions.txt", - include_bytes!("../test/data/subscriptions-blank-line.txt"), + include_bytes!("../../test/data/subscriptions-blank-line.txt"), )?; let file_env = FileEnv::default(); @@ -63,7 +63,7 @@ mod tests { //given let (dir, file_name) = create_text_file( "subscriptions.txt", - include_bytes!("../test/data/subscriptions-comment.txt"), + include_bytes!("../../test/data/subscriptions-comment.txt"), )?; let file_env = FileEnv::default(); diff --git a/src/lib.rs b/src/lib.rs index e51e116..74787a2 100644 --- a/src/lib.rs +++ b/src/lib.rs @@ -4,7 +4,6 @@ pub mod fetch; pub mod file; pub mod history; pub mod prelude; -mod subscriptions; #[cfg(test)] mod test_utils; @@ -23,7 +22,7 @@ pub struct Env { } pub fn run(subscriptions: &str, history: &str, site: &str, e: Env) -> Result<()> { - for channel_name in subscriptions::lines_from(subscriptions, &e.file)? { + for channel_name in file::read::lines_from(subscriptions, &e.file)? { println!("Channel: {}", channel_name); let feed_url = (e.feed.find)(site, &channel_name, &e.fetch.get)?; for entry in (e.feed.get)(&feed_url)?.entries() {