diff options
| author | Jokler <jokler.contact@gmail.com> | 2018-02-24 20:13:32 +0100 |
|---|---|---|
| committer | Jokler <jokler.contact@gmail.com> | 2018-02-24 20:13:32 +0100 |
| commit | ce2db228aac1c0114bcac30bb6c01212faca025a (patch) | |
| tree | 73dc3b12bbeccfcfde6151bc629a7d0e02397c88 /src/utils.rs | |
| parent | f24da1f5090d71a4963e05c5a76dad2eccac15bd (diff) | |
| download | frippy-ce2db228aac1c0114bcac30bb6c01212faca025a.tar.gz frippy-ce2db228aac1c0114bcac30bb6c01212faca025a.zip | |
Run rustfmt and clippy
Diffstat (limited to 'src/utils.rs')
| -rw-r--r-- | src/utils.rs | 13 |
1 files changed, 6 insertions, 7 deletions
diff --git a/src/utils.rs b/src/utils.rs index 59a5a54..0b965c8 100644 --- a/src/utils.rs +++ b/src/utils.rs @@ -7,10 +7,7 @@ use self::reqwest::Client; use self::reqwest::header::Connection; pub fn download(max_kib: usize, url: &str) -> Option<String> { - let response = Client::new() - .get(url) - .header(Connection::close()) - .send(); + let response = Client::new().get(url).header(Connection::close()).send(); match response { Ok(mut response) => { @@ -44,16 +41,18 @@ pub fn download(max_kib: usize, url: &str) -> Option<String> { // Check if the file is too large to download if written > max_kib * 1024 { - debug!("Stopping download - File from {:?} is larger than {} KiB", url, max_kib); + debug!( + "Stopping download - File from {:?} is larger than {} KiB", + url, max_kib + ); return None; } - } Some(body) } Err(e) => { debug!("Bad response from {:?}: ({})", url, e); - return None; + None } } } |
