cargo fmt

This commit is contained in:
Jordan Petridis 2018-03-30 17:24:38 +03:00
parent 2b711ff04c
commit 491cd8f01c
No known key found for this signature in database
GPG Key ID: CEABAD9F5683B9A6

View File

@ -242,7 +242,9 @@ fn lookup_id(id: u32) -> Result<String, Error> {
let url = format!("https://itunes.apple.com/lookup?id={}&entity=podcast", id); let url = format!("https://itunes.apple.com/lookup?id={}&entity=podcast", id);
let req: Value = reqwest::get(&url)?.json()?; let req: Value = reqwest::get(&url)?.json()?;
let rssurl = || -> Option<&str> { req.get("results")?.get(0)?.get("feedUrl")?.as_str() }; let rssurl = || -> Option<&str> { req.get("results")?.get(0)?.get("feedUrl")?.as_str() };
rssurl().map(From::from).ok_or_else(|| format_err!("Failed to get url from itunes response")) rssurl()
.map(From::from)
.ok_or_else(|| format_err!("Failed to get url from itunes response"))
} }
pub fn time_period_to_duration(time: i64, period: &str) -> Duration { pub fn time_period_to_duration(time: i64, period: &str) -> Duration {