diff --git a/Cargo.toml b/Cargo.toml index 11837bb..0c0743c 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -1,6 +1,6 @@ [package] name = "oscar" -version = "0.1.20" +version = "0.1.21" authors = ["Adam Simpson "] edition = "2018" description = "A CLI application to download videos from PBS. Ideally run in cron or another scheduler." diff --git a/src/json.rs b/src/json.rs index c896cfe..7f190e8 100644 --- a/src/json.rs +++ b/src/json.rs @@ -60,7 +60,7 @@ impl Episode { videos.sort_by(|a, b| a.quality_rating().cmp(&b.quality_rating())); - return videos[0].proper_url(); + videos[0].proper_url() } } @@ -85,11 +85,11 @@ impl Video { return 3; } - return 99; + 99 } fn proper_url(&self) -> String { - return self.url.to_string(); + self.url.to_string() } } diff --git a/src/main.rs b/src/main.rs index 1152d53..7b8ce0f 100644 --- a/src/main.rs +++ b/src/main.rs @@ -91,23 +91,20 @@ fn fetch_show_list() -> Result> { fn main() { let opts = Opt::from_args(); - match opts.command { - Some(Command::List) => { - let mut list = fetch_show_list().unwrap_or_else(|e| { - error!("List API request failed: {}", e); - process::exit(1) - }); - - list.tier_1.content.append(&mut list.tier_2.content); - list.tier_1.content.append(&mut list.tier_3.content); - - for item in list.tier_1.content.iter() { - println!("{:?}", item.slug); - } + if let Some(Command::List) = opts.command { + let mut list = fetch_show_list().unwrap_or_else(|e| { + error!("List API request failed: {}", e); + process::exit(1) + }); + + list.tier_1.content.append(&mut list.tier_2.content); + list.tier_1.content.append(&mut list.tier_3.content); - process::exit(0) + for item in list.tier_1.content.iter() { + println!("{:?}", item.slug); } - None => {} + + process::exit(0) } if !opts.silent {