Skip to content

Commit

Permalink
more clippy fixes
Browse files Browse the repository at this point in the history
  • Loading branch information
mcdallas committed Nov 3, 2022
1 parent b8e95cf commit 5a15e30
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 7 deletions.
2 changes: 1 addition & 1 deletion src/download.rs
Original file line number Diff line number Diff line change
Expand Up @@ -121,7 +121,7 @@ impl<'a> Downloader<'a> {
}

/// Download and save medias from Reddit in parallel
async fn download_collection(&self, collection: &Vec<Post>) -> Result<Summary, GertError> {
async fn download_collection(&self, collection: &[Post]) -> Result<Summary, GertError> {
let summary = Arc::new(Mutex::new(Summary {
media_supported: 0,
media_downloaded: 0,
Expand Down
3 changes: 2 additions & 1 deletion src/subreddit.rs
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
use std::fmt::Write;
use crate::errors::GertError;
use crate::structures::Listing;
use reqwest::Client;
Expand Down Expand Up @@ -26,7 +27,7 @@ impl Subreddit {
let url = &mut format!("{}/{}.json?limit={}", self.url, ty, limit);

if let Some(period) = options {
url.push_str(&format!("&t={}", period));
let _ = write!(url, "&t={}", period);
}

Ok(self.client.get(&url.to_owned()).send().await?.json::<Listing>().await?)
Expand Down
6 changes: 1 addition & 5 deletions src/utils.rs
Original file line number Diff line number Diff line change
Expand Up @@ -40,11 +40,7 @@ pub fn mask_sensitive(word: &str) -> String {

/// Check if the given application is present in the $PATH
pub fn application_present(name: String) -> bool {
let result = which(name);
match result {
Ok(_) => true,
_ => false,
}
which(name).is_ok()
}

/// Check if the given URL contains an MP4 track using the content type
Expand Down

0 comments on commit 5a15e30

Please sign in to comment.