diff --git a/src/feed/find.rs b/src/feed/find.rs index 537776f..f37ce84 100644 --- a/src/feed/find.rs +++ b/src/feed/find.rs @@ -31,7 +31,7 @@ mod tests { //given let fetch_get = &(get as FetchGet); //when - let result = find("site", "@channel", &fetch_get)?; + let result = find("site", "@channel", fetch_get)?; //then assert_eq!(result, "the-rss-url"); Ok(()) @@ -42,7 +42,7 @@ mod tests { //given let fetch_get = &(get as FetchGet); //when - let result = find("site", "invalid-channel-name", &fetch_get); + let result = find("site", "invalid-channel-name", fetch_get); //then assert!(result.is_err()); Ok(()) diff --git a/src/feed/get.rs b/src/feed/get.rs index dad28b0..1a7ea40 100644 --- a/src/feed/get.rs +++ b/src/feed/get.rs @@ -1,8 +1,8 @@ -use atom_syndication::Feed; - use crate::prelude::*; -pub fn get(url: &str) -> Result { +use atom_syndication::Feed; + +pub fn reqwest_blocking_get(url: &str) -> Result { let content = reqwest::blocking::get(url)?.bytes()?; let channel = Feed::read_from(&content[..])?; Ok(channel) diff --git a/src/feed/mod.rs b/src/feed/mod.rs index 8246422..253bf26 100644 --- a/src/feed/mod.rs +++ b/src/feed/mod.rs @@ -5,10 +5,9 @@ use crate::fetch::FetchGet; mod find; mod get; +use atom_syndication::Feed; pub use find::find; -pub use get::get; - -type Feed = atom_syndication::Feed; +pub use get::reqwest_blocking_get; pub struct FeedEnv { pub find: FeedFind, diff --git a/src/main.rs b/src/main.rs index c97df09..8e7f6c5 100644 --- a/src/main.rs +++ b/src/main.rs @@ -15,7 +15,7 @@ fn main() -> Result<()> { podal::Env { feed: FeedEnv { find: podal::feed::find, - get: podal::feed::get, + get: podal::feed::reqwest_blocking_get, }, history: HistoryEnv {