Skip to content

Commit

Permalink
Merge pull request #79 from nelsonjchen/clippy_apr_2021
Browse files Browse the repository at this point in the history
Clippy and Rollup Fixes April 2021
  • Loading branch information
nelsonjchen authored Apr 14, 2021
2 parents f027ff5 + 254dc97 commit d00249e
Show file tree
Hide file tree
Showing 3 changed files with 3 additions and 2 deletions.
2 changes: 1 addition & 1 deletion src/main.rs
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ fn main() -> Result<(), error::Error> {
env_logger::init();

let matches = App::new("speedtest-rs")
.version(&crate_version!()[..])
.version(crate_version!())
.about("Command line interface for testing internet bandwidth using speedtest.net.")
.arg(
Arg::with_name("no-download")
Expand Down
2 changes: 1 addition & 1 deletion src/speedtest.rs
Original file line number Diff line number Diff line change
Expand Up @@ -129,7 +129,7 @@ pub fn get_best_server_based_on_latency(
let latency = latency_measurements
.iter()
.fold(Duration::new(0, 0), |a, &i| a + i)
/ ((latency_measurements.iter().count() as u32) * 2);
/ ((latency_measurements.len() as u32) * 2);
info!("Trip calculated to {} ms", latency.as_millis());

if latency < fastest_latency {
Expand Down
1 change: 1 addition & 0 deletions src/speedtest_config.rs
Original file line number Diff line number Diff line change
Expand Up @@ -84,6 +84,7 @@ impl SpeedTestConfig {
.attribute("ignoreids")
.ok_or(Error::ConfigParseError)?
.split(',')
.filter(|s| !s.is_empty())
.map(|s| s.parse::<u32>())
.collect::<Result<Vec<u32>, _>>()?;

Expand Down

0 comments on commit d00249e

Please sign in to comment.