[INFO] cloning repository https://github.com/moncruist/runstats [INFO] running `Command { std: "git" "-c" "credential.helper=" "-c" "credential.helper=/workspace/cargo-home/bin/git-credential-null" "clone" "--bare" "https://github.com/moncruist/runstats" "/workspace/cache/git-repos/https%3A%2F%2Fgithub.com%2Fmoncruist%2Frunstats", kill_on_drop: false }` [INFO] [stderr] Cloning into bare repository '/workspace/cache/git-repos/https%3A%2F%2Fgithub.com%2Fmoncruist%2Frunstats'... [INFO] running `Command { std: "git" "rev-parse" "HEAD", kill_on_drop: false }` [INFO] [stdout] c918fab52e6ada93e32f6268284c1d357815abfe [INFO] linting moncruist/runstats against nightly for clippy-nonminimal_bool-denied [INFO] running `Command { std: "git" "clone" "/workspace/cache/git-repos/https%3A%2F%2Fgithub.com%2Fmoncruist%2Frunstats" "/workspace/builds/worker-2-tc1/source", kill_on_drop: false }` [INFO] [stderr] Cloning into '/workspace/builds/worker-2-tc1/source'... [INFO] [stderr] done. [INFO] started tweaking git repo https://github.com/moncruist/runstats [INFO] finished tweaking git repo https://github.com/moncruist/runstats [INFO] tweaked toml for git repo https://github.com/moncruist/runstats written to /workspace/builds/worker-2-tc1/source/Cargo.toml [INFO] validating manifest of git repo https://github.com/moncruist/runstats on toolchain nightly [INFO] running `Command { std: CARGO_HOME="/workspace/cargo-home" RUSTUP_HOME="/workspace/rustup-home" "/workspace/cargo-home/bin/cargo" "+nightly" "metadata" "--manifest-path" "Cargo.toml" "--no-deps", kill_on_drop: false }` [INFO] crate git repo https://github.com/moncruist/runstats already has a lockfile, it will not be regenerated [INFO] running `Command { std: CARGO_HOME="/workspace/cargo-home" RUSTUP_HOME="/workspace/rustup-home" "/workspace/cargo-home/bin/cargo" "+nightly" "fetch" "--manifest-path" "Cargo.toml", kill_on_drop: false }` [INFO] [stderr] Updating crates.io index [INFO] [stderr] Downloading crates ... [INFO] [stderr] Downloaded version_check v0.9.1 [INFO] [stderr] Downloaded test-case v1.0.0 [INFO] [stderr] Downloaded time v0.1.43 [INFO] [stderr] Downloaded proc-macro2 v1.0.12 [INFO] [stderr] Downloaded quote v1.0.5 [INFO] [stderr] Downloaded autocfg v1.0.0 [INFO] [stderr] Downloaded num-integer v0.1.42 [INFO] [stderr] Downloaded num-traits v0.2.11 [INFO] [stderr] Downloaded xml-rs v0.8.3 [INFO] [stderr] Downloaded chrono v0.4.11 [INFO] [stderr] Downloaded syn v1.0.21 [INFO] [stderr] Downloaded libc v0.2.70 [INFO] running `Command { std: "docker" "create" "-v" "/var/lib/crater-agent-workspace/builds/worker-2-tc1/target:/opt/rustwide/target:rw,Z" "-v" "/var/lib/crater-agent-workspace/builds/worker-2-tc1/source:/opt/rustwide/workdir:ro,Z" "-v" "/var/lib/crater-agent-workspace/cargo-home:/opt/rustwide/cargo-home:ro,Z" "-v" "/var/lib/crater-agent-workspace/rustup-home:/opt/rustwide/rustup-home:ro,Z" "-e" "SOURCE_DIR=/opt/rustwide/workdir" "-e" "CARGO_TARGET_DIR=/opt/rustwide/target" "-e" "CARGO_HOME=/opt/rustwide/cargo-home" "-e" "RUSTUP_HOME=/opt/rustwide/rustup-home" "-w" "/opt/rustwide/workdir" "-m" "1610612736" "--user" "0:0" "--network" "none" "ghcr.io/rust-lang/crates-build-env/linux@sha256:d429b63d4308055ea97f60fb1d3dfca48854a00942f1bd2ad806beaf015945ec" "/opt/rustwide/cargo-home/bin/cargo" "+nightly" "metadata" "--no-deps" "--format-version=1", kill_on_drop: false }` [INFO] [stdout] bbb1b4c1fd89f7cd553a45b66449f60bf48923640f5f429b41fd0b8ffddb09bc [INFO] running `Command { std: "docker" "start" "-a" "bbb1b4c1fd89f7cd553a45b66449f60bf48923640f5f429b41fd0b8ffddb09bc", kill_on_drop: false }` [INFO] running `Command { std: "docker" "inspect" "bbb1b4c1fd89f7cd553a45b66449f60bf48923640f5f429b41fd0b8ffddb09bc", kill_on_drop: false }` [INFO] running `Command { std: "docker" "rm" "-f" "bbb1b4c1fd89f7cd553a45b66449f60bf48923640f5f429b41fd0b8ffddb09bc", kill_on_drop: false }` [INFO] [stdout] bbb1b4c1fd89f7cd553a45b66449f60bf48923640f5f429b41fd0b8ffddb09bc [INFO] running `Command { std: "docker" "create" "-v" "/var/lib/crater-agent-workspace/builds/worker-2-tc1/target:/opt/rustwide/target:rw,Z" "-v" "/var/lib/crater-agent-workspace/builds/worker-2-tc1/source:/opt/rustwide/workdir:ro,Z" "-v" "/var/lib/crater-agent-workspace/cargo-home:/opt/rustwide/cargo-home:ro,Z" "-v" "/var/lib/crater-agent-workspace/rustup-home:/opt/rustwide/rustup-home:ro,Z" "-e" "SOURCE_DIR=/opt/rustwide/workdir" "-e" "CARGO_TARGET_DIR=/opt/rustwide/target" "-e" "CARGO_INCREMENTAL=0" "-e" "RUST_BACKTRACE=full" "-e" "RUSTFLAGS=--cap-lints=forbid" "-e" "RUSTDOCFLAGS=--cap-lints=forbid" "-e" "CARGO_HOME=/opt/rustwide/cargo-home" "-e" "RUSTUP_HOME=/opt/rustwide/rustup-home" "-w" "/opt/rustwide/workdir" "-m" "1610612736" "--user" "0:0" "--network" "none" "ghcr.io/rust-lang/crates-build-env/linux@sha256:d429b63d4308055ea97f60fb1d3dfca48854a00942f1bd2ad806beaf015945ec" "/opt/rustwide/cargo-home/bin/cargo" "+nightly" "clippy" "--frozen" "--all" "--all-targets" "--message-format=json", kill_on_drop: false }` [INFO] [stdout] 86df4cb328ce16d45149c71ba7e7822eae48bc948b1c31e833fd72b4ba4e2345 [INFO] running `Command { std: "docker" "start" "-a" "86df4cb328ce16d45149c71ba7e7822eae48bc948b1c31e833fd72b4ba4e2345", kill_on_drop: false }` [INFO] [stderr] Compiling autocfg v1.0.0 [INFO] [stderr] Compiling libc v0.2.70 [INFO] [stderr] Compiling proc-macro2 v1.0.12 [INFO] [stderr] Compiling version_check v0.9.1 [INFO] [stderr] Compiling syn v1.0.21 [INFO] [stderr] Checking xml-rs v0.8.3 [INFO] [stderr] Compiling test-case v1.0.0 [INFO] [stderr] Compiling num-traits v0.2.11 [INFO] [stderr] Compiling num-integer v0.1.42 [INFO] [stderr] Checking time v0.1.43 [INFO] [stderr] Compiling quote v1.0.5 [INFO] [stderr] Checking chrono v0.4.11 [INFO] [stderr] Checking runstats v0.1.0 (/opt/rustwide/workdir) [INFO] [stdout] warning: constants have by default a `'static` lifetime [INFO] [stdout] --> src/gpx_parser.rs:71:31 [INFO] [stdout] | [INFO] [stdout] 71 | const TOPOGRAFIX_GPX_SCHEMA: &'static str = "http://www.topografix.com/GPX/1/1"; [INFO] [stdout] | -^^^^^^^---- help: consider removing `'static`: `&str` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#redundant_static_lifetimes [INFO] [stdout] = note: `#[warn(clippy::redundant_static_lifetimes)]` on by default [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: constants have by default a `'static` lifetime [INFO] [stdout] --> src/gpx_parser.rs:72:39 [INFO] [stdout] | [INFO] [stdout] 72 | const GARMIN_TRACK_POINT_EXT_SCHEMA: &'static str = [INFO] [stdout] | -^^^^^^^---- help: consider removing `'static`: `&str` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#redundant_static_lifetimes [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: constants have by default a `'static` lifetime [INFO] [stdout] --> src/gpx_parser.rs:75:35 [INFO] [stdout] | [INFO] [stdout] 75 | const TOPOGRAFIX_GPX_MAPPINGS: [(&'static str, GpxXmlTag); 8] = [ [INFO] [stdout] | -^^^^^^^---- help: consider removing `'static`: `&str` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#redundant_static_lifetimes [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: constants have by default a `'static` lifetime [INFO] [stdout] --> src/gpx_parser.rs:86:43 [INFO] [stdout] | [INFO] [stdout] 86 | const GARMIN_TRACK_POINT_EXT_MAPPINGS: [(&'static str, GpxXmlTag); 2] = [ [INFO] [stdout] | -^^^^^^^---- help: consider removing `'static`: `&str` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#redundant_static_lifetimes [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: manual implementation of `Option::map` [INFO] [stdout] --> src/gpx_parser.rs:93:5 [INFO] [stdout] | [INFO] [stdout] 93 | / match found { [INFO] [stdout] 94 | | Some((_, value)) => Some(*value), [INFO] [stdout] 95 | | None => None, [INFO] [stdout] 96 | | } [INFO] [stdout] | |_____^ help: try: `found.map(|(_, value)| *value)` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#manual_map [INFO] [stdout] = note: `#[warn(clippy::manual_map)]` on by default [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this block may be rewritten with the `?` operator [INFO] [stdout] --> src/gpx_parser.rs:100:5 [INFO] [stdout] | [INFO] [stdout] 100 | / if name.namespace.is_none() { [INFO] [stdout] 101 | | return None; [INFO] [stdout] 102 | | } [INFO] [stdout] | |_____^ help: replace it with: `name.namespace.as_ref()?;` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#question_mark [INFO] [stdout] = note: `#[warn(clippy::question_mark)]` on by default [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: you seem to be trying to use `match` for destructuring a single pattern. Consider using `if let` [INFO] [stdout] --> src/gpx_parser.rs:220:13 [INFO] [stdout] | [INFO] [stdout] 220 | / match start_time { [INFO] [stdout] 221 | | Err(_) => return Err(ParseError::XmlError), [INFO] [stdout] 222 | | _ => {} [INFO] [stdout] 223 | | } [INFO] [stdout] | |_____________^ help: try: `if let Err(_) = start_time { return Err(ParseError::XmlError) }` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#single_match [INFO] [stdout] = note: `#[warn(clippy::single_match)]` on by default [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: length comparison to zero [INFO] [stdout] --> src/gpx_parser.rs:233:21 [INFO] [stdout] | [INFO] [stdout] 233 | if (context.current_segment.points.len() > 0) [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: using `!is_empty` is clearer and more explicit: `!context.current_segment.points.is_empty()` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#len_zero [INFO] [stdout] = note: `#[warn(clippy::len_zero)]` on by default [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: consider using `sort_by_key` [INFO] [stdout] --> src/gpx_parser.rs:275:17 [INFO] [stdout] | [INFO] [stdout] 275 | / context [INFO] [stdout] 276 | | .current_segment [INFO] [stdout] 277 | | .points [INFO] [stdout] 278 | | .sort_by(|a, b| a.time.cmp(&b.time)); [INFO] [stdout] | |________________________________________________________^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#unnecessary_sort_by [INFO] [stdout] = note: `#[warn(clippy::unnecessary_sort_by)]` on by default [INFO] [stdout] help: try [INFO] [stdout] | [INFO] [stdout] 278 - .sort_by(|a, b| a.time.cmp(&b.time)); [INFO] [stdout] 278 + .sort_by_key(|a| a.time); [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this block may be rewritten with the `?` operator [INFO] [stdout] --> src/gpx_parser.rs:308:17 [INFO] [stdout] | [INFO] [stdout] 308 | / if let Err(err) = parse_start_xml_element(tag, &attributes, &mut context) { [INFO] [stdout] 309 | | return Err(err); [INFO] [stdout] 310 | | } [INFO] [stdout] | |_________________^ help: replace it with: `parse_start_xml_element(tag, &attributes, &mut context)?` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#question_mark [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this block may be rewritten with the `?` operator [INFO] [stdout] --> src/gpx_parser.rs:322:17 [INFO] [stdout] | [INFO] [stdout] 322 | / if let Err(err) = parse_xml_characters(characters, &mut track, &mut context) { [INFO] [stdout] 323 | | return Err(err); [INFO] [stdout] 324 | | } [INFO] [stdout] | |_________________^ help: replace it with: `parse_xml_characters(characters, &mut track, &mut context)?` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#question_mark [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: returning the result of a `let` binding from a block [INFO] [stdout] --> src/stats.rs:60:5 [INFO] [stdout] | [INFO] [stdout] 59 | let hypot = (cathet1 * cathet1 + cathet2 * cathet2).sqrt(); [INFO] [stdout] | ----------------------------------------------------------- unnecessary `let` binding [INFO] [stdout] 60 | hypot [INFO] [stdout] | ^^^^^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#let_and_return [INFO] [stdout] = note: `#[warn(clippy::let_and_return)]` on by default [INFO] [stdout] help: return the expression directly [INFO] [stdout] | [INFO] [stdout] 59 ~ [INFO] [stdout] 60 ~ (cathet1 * cathet1 + cathet2 * cathet2).sqrt() [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: length comparison to zero [INFO] [stdout] --> src/stats.rs:101:8 [INFO] [stdout] | [INFO] [stdout] 101 | if points.len() == 0 { [INFO] [stdout] | ^^^^^^^^^^^^^^^^^ help: using `is_empty` is clearer and more explicit: `points.is_empty()` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#len_zero [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: manual checked division [INFO] [stdout] --> src/stats.rs:178:8 [INFO] [stdout] | [INFO] [stdout] 178 | if total_duration_sec != 0 { [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^ check performed here [INFO] [stdout] 179 | (sum / total_duration_sec) as u8 [INFO] [stdout] | -------------------------- division performed here [INFO] [stdout] | [INFO] [stdout] = help: consider using `checked_div` [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#manual_checked_ops [INFO] [stdout] = note: `#[warn(clippy::manual_checked_ops)]` on by default [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: you should consider adding a `Default` implementation for `TrackPoint` [INFO] [stdout] --> src/lib.rs:38:5 [INFO] [stdout] | [INFO] [stdout] 38 | / pub fn new() -> TrackPoint { [INFO] [stdout] 39 | | TrackPoint { [INFO] [stdout] 40 | | latitude: 0.0, [INFO] [stdout] 41 | | longitude: 0.0, [INFO] [stdout] ... | [INFO] [stdout] 47 | | } [INFO] [stdout] | |_____^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#new_without_default [INFO] [stdout] = note: `#[warn(clippy::new_without_default)]` on by default [INFO] [stdout] help: try adding this [INFO] [stdout] | [INFO] [stdout] 37 + impl Default for TrackPoint { [INFO] [stdout] 38 + fn default() -> Self { [INFO] [stdout] 39 + Self::new() [INFO] [stdout] 40 + } [INFO] [stdout] 41 + } [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: you should consider adding a `Default` implementation for `TrackSegment` [INFO] [stdout] --> src/lib.rs:67:5 [INFO] [stdout] | [INFO] [stdout] 67 | / pub fn new() ->TrackSegment { [INFO] [stdout] 68 | | TrackSegment { points: Vec::new() } [INFO] [stdout] 69 | | } [INFO] [stdout] | |_____^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#new_without_default [INFO] [stdout] help: try adding this [INFO] [stdout] | [INFO] [stdout] 66 + impl Default for TrackSegment { [INFO] [stdout] 67 + fn default() -> Self { [INFO] [stdout] 68 + Self::new() [INFO] [stdout] 69 + } [INFO] [stdout] 70 + } [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: you should consider adding a `Default` implementation for `Track` [INFO] [stdout] --> src/lib.rs:80:5 [INFO] [stdout] | [INFO] [stdout] 80 | / pub fn new() -> Track { [INFO] [stdout] 81 | | Track { [INFO] [stdout] 82 | | name: String::new(), [INFO] [stdout] 83 | | creation_time: None, [INFO] [stdout] ... | [INFO] [stdout] 86 | | } [INFO] [stdout] | |_____^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#new_without_default [INFO] [stdout] help: try adding this [INFO] [stdout] | [INFO] [stdout] 79 + impl Default for Track { [INFO] [stdout] 80 + fn default() -> Self { [INFO] [stdout] 81 + Self::new() [INFO] [stdout] 82 + } [INFO] [stdout] 83 + } [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this expression creates a reference which is immediately dereferenced by the compiler [INFO] [stdout] --> src/lib.rs:97:46 [INFO] [stdout] | [INFO] [stdout] 97 | stats::calc_track_average_heart_rate(&self) [INFO] [stdout] | ^^^^^ help: change this to: `self` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_borrow [INFO] [stdout] = note: `#[warn(clippy::needless_borrow)]` on by default [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this boolean expression can be simplified [INFO] [stdout] --> src/main.rs:30:8 [INFO] [stdout] | [INFO] [stdout] 30 | if !fs::metadata(gpx_path).is_ok() { [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: try: `fs::metadata(gpx_path).is_err()` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#nonminimal_bool [INFO] [stdout] = note: `#[warn(clippy::nonminimal_bool)]` on by default [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: the loop variable `i` is used to index `splits` [INFO] [stdout] --> src/main.rs:43:18 [INFO] [stdout] | [INFO] [stdout] 43 | for i in 0..splits.len() { [INFO] [stdout] | ^^^^^^^^^^^^^^^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_range_loop [INFO] [stdout] = note: `#[warn(clippy::needless_range_loop)]` on by default [INFO] [stdout] help: consider using an iterator and enumerate() [INFO] [stdout] | [INFO] [stdout] 43 - for i in 0..splits.len() { [INFO] [stdout] 43 + for (i, ) in splits.iter().enumerate() { [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this boolean expression can be simplified [INFO] [stdout] --> src/main.rs:30:8 [INFO] [stdout] | [INFO] [stdout] 30 | if !fs::metadata(gpx_path).is_ok() { [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: try: `fs::metadata(gpx_path).is_err()` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#nonminimal_bool [INFO] [stdout] = note: `#[warn(clippy::nonminimal_bool)]` on by default [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: the loop variable `i` is used to index `splits` [INFO] [stdout] --> src/main.rs:43:18 [INFO] [stdout] | [INFO] [stdout] 43 | for i in 0..splits.len() { [INFO] [stdout] | ^^^^^^^^^^^^^^^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_range_loop [INFO] [stdout] = note: `#[warn(clippy::needless_range_loop)]` on by default [INFO] [stdout] help: consider using an iterator and enumerate() [INFO] [stdout] | [INFO] [stdout] 43 - for i in 0..splits.len() { [INFO] [stdout] 43 + for (i, ) in splits.iter().enumerate() { [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: constants have by default a `'static` lifetime [INFO] [stdout] --> src/gpx_parser.rs:71:31 [INFO] [stdout] | [INFO] [stdout] 71 | const TOPOGRAFIX_GPX_SCHEMA: &'static str = "http://www.topografix.com/GPX/1/1"; [INFO] [stdout] | -^^^^^^^---- help: consider removing `'static`: `&str` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#redundant_static_lifetimes [INFO] [stdout] = note: `#[warn(clippy::redundant_static_lifetimes)]` on by default [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: constants have by default a `'static` lifetime [INFO] [stdout] --> src/gpx_parser.rs:72:39 [INFO] [stdout] | [INFO] [stdout] 72 | const GARMIN_TRACK_POINT_EXT_SCHEMA: &'static str = [INFO] [stdout] | -^^^^^^^---- help: consider removing `'static`: `&str` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#redundant_static_lifetimes [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: constants have by default a `'static` lifetime [INFO] [stdout] --> src/gpx_parser.rs:75:35 [INFO] [stdout] | [INFO] [stdout] 75 | const TOPOGRAFIX_GPX_MAPPINGS: [(&'static str, GpxXmlTag); 8] = [ [INFO] [stdout] | -^^^^^^^---- help: consider removing `'static`: `&str` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#redundant_static_lifetimes [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: constants have by default a `'static` lifetime [INFO] [stdout] --> src/gpx_parser.rs:86:43 [INFO] [stdout] | [INFO] [stdout] 86 | const GARMIN_TRACK_POINT_EXT_MAPPINGS: [(&'static str, GpxXmlTag); 2] = [ [INFO] [stdout] | -^^^^^^^---- help: consider removing `'static`: `&str` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#redundant_static_lifetimes [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: unneeded unit expression [INFO] [stdout] --> src/gpx_parser.rs:350:5 [INFO] [stdout] | [INFO] [stdout] 350 | #[test_case("gpx", GpxXmlTag::Gpx; "gpx tag")] [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#unused_unit [INFO] [stdout] = note: `#[warn(clippy::unused_unit)]` on by default [INFO] [stdout] = note: this warning originates in the attribute macro `test_case` (in Nightly builds, run with -Z macro-backtrace for more info) [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: unneeded unit expression [INFO] [stdout] --> src/gpx_parser.rs:369:5 [INFO] [stdout] | [INFO] [stdout] 369 | #[test_case("hr", GpxXmlTag::ExtHeartRate; "hr tag")] [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#unused_unit [INFO] [stdout] = note: this warning originates in the attribute macro `test_case` (in Nightly builds, run with -Z macro-backtrace for more info) [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this is a decimal constant [INFO] [stdout] --> src/gpx_parser.rs:449:62 [INFO] [stdout] | [INFO] [stdout] 449 | let expected_time = Utc.ymd(2020, 4, 22).and_hms(16, 01, 58); [INFO] [stdout] | ^^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#zero_prefixed_literal [INFO] [stdout] = note: `#[warn(clippy::zero_prefixed_literal)]` on by default [INFO] [stdout] help: if you mean to use a decimal constant, remove the `0` to avoid confusion [INFO] [stdout] | [INFO] [stdout] 449 - let expected_time = Utc.ymd(2020, 4, 22).and_hms(16, 01, 58); [INFO] [stdout] 449 + let expected_time = Utc.ymd(2020, 4, 22).and_hms(16, 1, 58); [INFO] [stdout] | [INFO] [stdout] help: if you mean to use an octal constant, use `0o` [INFO] [stdout] | [INFO] [stdout] 449 | let expected_time = Utc.ymd(2020, 4, 22).and_hms(16, 0o1, 58); [INFO] [stdout] | + [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this is a decimal constant [INFO] [stdout] --> src/gpx_parser.rs:501:62 [INFO] [stdout] | [INFO] [stdout] 501 | let expected_time = Utc.ymd(2020, 4, 22).and_hms(16, 01, 58); [INFO] [stdout] | ^^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#zero_prefixed_literal [INFO] [stdout] help: if you mean to use a decimal constant, remove the `0` to avoid confusion [INFO] [stdout] | [INFO] [stdout] 501 - let expected_time = Utc.ymd(2020, 4, 22).and_hms(16, 01, 58); [INFO] [stdout] 501 + let expected_time = Utc.ymd(2020, 4, 22).and_hms(16, 1, 58); [INFO] [stdout] | [INFO] [stdout] help: if you mean to use an octal constant, use `0o` [INFO] [stdout] | [INFO] [stdout] 501 | let expected_time = Utc.ymd(2020, 4, 22).and_hms(16, 0o1, 58); [INFO] [stdout] | + [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this is a decimal constant [INFO] [stdout] --> src/gpx_parser.rs:504:61 [INFO] [stdout] | [INFO] [stdout] 504 | let point_0_time = Utc.ymd(2020, 4, 22).and_hms(16, 01, 58); [INFO] [stdout] | ^^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#zero_prefixed_literal [INFO] [stdout] help: if you mean to use a decimal constant, remove the `0` to avoid confusion [INFO] [stdout] | [INFO] [stdout] 504 - let point_0_time = Utc.ymd(2020, 4, 22).and_hms(16, 01, 58); [INFO] [stdout] 504 + let point_0_time = Utc.ymd(2020, 4, 22).and_hms(16, 1, 58); [INFO] [stdout] | [INFO] [stdout] help: if you mean to use an octal constant, use `0o` [INFO] [stdout] | [INFO] [stdout] 504 | let point_0_time = Utc.ymd(2020, 4, 22).and_hms(16, 0o1, 58); [INFO] [stdout] | + [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this is a decimal constant [INFO] [stdout] --> src/gpx_parser.rs:512:61 [INFO] [stdout] | [INFO] [stdout] 512 | let point_1_time = Utc.ymd(2020, 4, 22).and_hms(16, 02, 04); [INFO] [stdout] | ^^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#zero_prefixed_literal [INFO] [stdout] help: if you mean to use a decimal constant, remove the `0` to avoid confusion [INFO] [stdout] | [INFO] [stdout] 512 - let point_1_time = Utc.ymd(2020, 4, 22).and_hms(16, 02, 04); [INFO] [stdout] 512 + let point_1_time = Utc.ymd(2020, 4, 22).and_hms(16, 2, 04); [INFO] [stdout] | [INFO] [stdout] help: if you mean to use an octal constant, use `0o` [INFO] [stdout] | [INFO] [stdout] 512 | let point_1_time = Utc.ymd(2020, 4, 22).and_hms(16, 0o2, 04); [INFO] [stdout] | + [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this is a decimal constant [INFO] [stdout] --> src/gpx_parser.rs:512:65 [INFO] [stdout] | [INFO] [stdout] 512 | let point_1_time = Utc.ymd(2020, 4, 22).and_hms(16, 02, 04); [INFO] [stdout] | ^^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#zero_prefixed_literal [INFO] [stdout] help: if you mean to use a decimal constant, remove the `0` to avoid confusion [INFO] [stdout] | [INFO] [stdout] 512 - let point_1_time = Utc.ymd(2020, 4, 22).and_hms(16, 02, 04); [INFO] [stdout] 512 + let point_1_time = Utc.ymd(2020, 4, 22).and_hms(16, 02, 4); [INFO] [stdout] | [INFO] [stdout] help: if you mean to use an octal constant, use `0o` [INFO] [stdout] | [INFO] [stdout] 512 | let point_1_time = Utc.ymd(2020, 4, 22).and_hms(16, 02, 0o4); [INFO] [stdout] | + [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this is a decimal constant [INFO] [stdout] --> src/gpx_parser.rs:569:62 [INFO] [stdout] | [INFO] [stdout] 569 | let expected_time = Utc.ymd(2020, 4, 22).and_hms(16, 01, 58); [INFO] [stdout] | ^^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#zero_prefixed_literal [INFO] [stdout] help: if you mean to use a decimal constant, remove the `0` to avoid confusion [INFO] [stdout] | [INFO] [stdout] 569 - let expected_time = Utc.ymd(2020, 4, 22).and_hms(16, 01, 58); [INFO] [stdout] 569 + let expected_time = Utc.ymd(2020, 4, 22).and_hms(16, 1, 58); [INFO] [stdout] | [INFO] [stdout] help: if you mean to use an octal constant, use `0o` [INFO] [stdout] | [INFO] [stdout] 569 | let expected_time = Utc.ymd(2020, 4, 22).and_hms(16, 0o1, 58); [INFO] [stdout] | + [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this is a decimal constant [INFO] [stdout] --> src/gpx_parser.rs:572:61 [INFO] [stdout] | [INFO] [stdout] 572 | let point_0_time = Utc.ymd(2020, 4, 22).and_hms(16, 01, 58); [INFO] [stdout] | ^^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#zero_prefixed_literal [INFO] [stdout] help: if you mean to use a decimal constant, remove the `0` to avoid confusion [INFO] [stdout] | [INFO] [stdout] 572 - let point_0_time = Utc.ymd(2020, 4, 22).and_hms(16, 01, 58); [INFO] [stdout] 572 + let point_0_time = Utc.ymd(2020, 4, 22).and_hms(16, 1, 58); [INFO] [stdout] | [INFO] [stdout] help: if you mean to use an octal constant, use `0o` [INFO] [stdout] | [INFO] [stdout] 572 | let point_0_time = Utc.ymd(2020, 4, 22).and_hms(16, 0o1, 58); [INFO] [stdout] | + [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this is a decimal constant [INFO] [stdout] --> src/gpx_parser.rs:580:61 [INFO] [stdout] | [INFO] [stdout] 580 | let point_1_time = Utc.ymd(2020, 4, 22).and_hms(16, 02, 04); [INFO] [stdout] | ^^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#zero_prefixed_literal [INFO] [stdout] help: if you mean to use a decimal constant, remove the `0` to avoid confusion [INFO] [stdout] | [INFO] [stdout] 580 - let point_1_time = Utc.ymd(2020, 4, 22).and_hms(16, 02, 04); [INFO] [stdout] 580 + let point_1_time = Utc.ymd(2020, 4, 22).and_hms(16, 2, 04); [INFO] [stdout] | [INFO] [stdout] help: if you mean to use an octal constant, use `0o` [INFO] [stdout] | [INFO] [stdout] 580 | let point_1_time = Utc.ymd(2020, 4, 22).and_hms(16, 0o2, 04); [INFO] [stdout] | + [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this is a decimal constant [INFO] [stdout] --> src/gpx_parser.rs:580:65 [INFO] [stdout] | [INFO] [stdout] 580 | let point_1_time = Utc.ymd(2020, 4, 22).and_hms(16, 02, 04); [INFO] [stdout] | ^^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#zero_prefixed_literal [INFO] [stdout] help: if you mean to use a decimal constant, remove the `0` to avoid confusion [INFO] [stdout] | [INFO] [stdout] 580 - let point_1_time = Utc.ymd(2020, 4, 22).and_hms(16, 02, 04); [INFO] [stdout] 580 + let point_1_time = Utc.ymd(2020, 4, 22).and_hms(16, 02, 4); [INFO] [stdout] | [INFO] [stdout] help: if you mean to use an octal constant, use `0o` [INFO] [stdout] | [INFO] [stdout] 580 | let point_1_time = Utc.ymd(2020, 4, 22).and_hms(16, 02, 0o4); [INFO] [stdout] | + [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this is a decimal constant [INFO] [stdout] --> src/gpx_parser.rs:661:62 [INFO] [stdout] | [INFO] [stdout] 661 | let expected_time = Utc.ymd(2020, 4, 22).and_hms(16, 01, 58); [INFO] [stdout] | ^^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#zero_prefixed_literal [INFO] [stdout] help: if you mean to use a decimal constant, remove the `0` to avoid confusion [INFO] [stdout] | [INFO] [stdout] 661 - let expected_time = Utc.ymd(2020, 4, 22).and_hms(16, 01, 58); [INFO] [stdout] 661 + let expected_time = Utc.ymd(2020, 4, 22).and_hms(16, 1, 58); [INFO] [stdout] | [INFO] [stdout] help: if you mean to use an octal constant, use `0o` [INFO] [stdout] | [INFO] [stdout] 661 | let expected_time = Utc.ymd(2020, 4, 22).and_hms(16, 0o1, 58); [INFO] [stdout] | + [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this is a decimal constant [INFO] [stdout] --> src/gpx_parser.rs:664:61 [INFO] [stdout] | [INFO] [stdout] 664 | let point_0_time = Utc.ymd(2020, 4, 22).and_hms(16, 01, 58); [INFO] [stdout] | ^^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#zero_prefixed_literal [INFO] [stdout] help: if you mean to use a decimal constant, remove the `0` to avoid confusion [INFO] [stdout] | [INFO] [stdout] 664 - let point_0_time = Utc.ymd(2020, 4, 22).and_hms(16, 01, 58); [INFO] [stdout] 664 + let point_0_time = Utc.ymd(2020, 4, 22).and_hms(16, 1, 58); [INFO] [stdout] | [INFO] [stdout] help: if you mean to use an octal constant, use `0o` [INFO] [stdout] | [INFO] [stdout] 664 | let point_0_time = Utc.ymd(2020, 4, 22).and_hms(16, 0o1, 58); [INFO] [stdout] | + [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this is a decimal constant [INFO] [stdout] --> src/gpx_parser.rs:672:61 [INFO] [stdout] | [INFO] [stdout] 672 | let point_1_time = Utc.ymd(2020, 4, 22).and_hms(16, 02, 04); [INFO] [stdout] | ^^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#zero_prefixed_literal [INFO] [stdout] help: if you mean to use a decimal constant, remove the `0` to avoid confusion [INFO] [stdout] | [INFO] [stdout] 672 - let point_1_time = Utc.ymd(2020, 4, 22).and_hms(16, 02, 04); [INFO] [stdout] 672 + let point_1_time = Utc.ymd(2020, 4, 22).and_hms(16, 2, 04); [INFO] [stdout] | [INFO] [stdout] help: if you mean to use an octal constant, use `0o` [INFO] [stdout] | [INFO] [stdout] 672 | let point_1_time = Utc.ymd(2020, 4, 22).and_hms(16, 0o2, 04); [INFO] [stdout] | + [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this is a decimal constant [INFO] [stdout] --> src/gpx_parser.rs:672:65 [INFO] [stdout] | [INFO] [stdout] 672 | let point_1_time = Utc.ymd(2020, 4, 22).and_hms(16, 02, 04); [INFO] [stdout] | ^^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#zero_prefixed_literal [INFO] [stdout] help: if you mean to use a decimal constant, remove the `0` to avoid confusion [INFO] [stdout] | [INFO] [stdout] 672 - let point_1_time = Utc.ymd(2020, 4, 22).and_hms(16, 02, 04); [INFO] [stdout] 672 + let point_1_time = Utc.ymd(2020, 4, 22).and_hms(16, 02, 4); [INFO] [stdout] | [INFO] [stdout] help: if you mean to use an octal constant, use `0o` [INFO] [stdout] | [INFO] [stdout] 672 | let point_1_time = Utc.ymd(2020, 4, 22).and_hms(16, 02, 0o4); [INFO] [stdout] | + [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this is a decimal constant [INFO] [stdout] --> src/gpx_parser.rs:680:61 [INFO] [stdout] | [INFO] [stdout] 680 | let point_2_time = Utc.ymd(2020, 4, 22).and_hms(16, 02, 30); [INFO] [stdout] | ^^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#zero_prefixed_literal [INFO] [stdout] help: if you mean to use a decimal constant, remove the `0` to avoid confusion [INFO] [stdout] | [INFO] [stdout] 680 - let point_2_time = Utc.ymd(2020, 4, 22).and_hms(16, 02, 30); [INFO] [stdout] 680 + let point_2_time = Utc.ymd(2020, 4, 22).and_hms(16, 2, 30); [INFO] [stdout] | [INFO] [stdout] help: if you mean to use an octal constant, use `0o` [INFO] [stdout] | [INFO] [stdout] 680 | let point_2_time = Utc.ymd(2020, 4, 22).and_hms(16, 0o2, 30); [INFO] [stdout] | + [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this is a decimal constant [INFO] [stdout] --> src/gpx_parser.rs:688:61 [INFO] [stdout] | [INFO] [stdout] 688 | let point_3_time = Utc.ymd(2020, 4, 22).and_hms(16, 02, 36); [INFO] [stdout] | ^^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#zero_prefixed_literal [INFO] [stdout] help: if you mean to use a decimal constant, remove the `0` to avoid confusion [INFO] [stdout] | [INFO] [stdout] 688 - let point_3_time = Utc.ymd(2020, 4, 22).and_hms(16, 02, 36); [INFO] [stdout] 688 + let point_3_time = Utc.ymd(2020, 4, 22).and_hms(16, 2, 36); [INFO] [stdout] | [INFO] [stdout] help: if you mean to use an octal constant, use `0o` [INFO] [stdout] | [INFO] [stdout] 688 | let point_3_time = Utc.ymd(2020, 4, 22).and_hms(16, 0o2, 36); [INFO] [stdout] | + [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: manual implementation of `Option::map` [INFO] [stdout] --> src/gpx_parser.rs:93:5 [INFO] [stdout] | [INFO] [stdout] 93 | / match found { [INFO] [stdout] 94 | | Some((_, value)) => Some(*value), [INFO] [stdout] 95 | | None => None, [INFO] [stdout] 96 | | } [INFO] [stdout] | |_____^ help: try: `found.map(|(_, value)| *value)` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#manual_map [INFO] [stdout] = note: `#[warn(clippy::manual_map)]` on by default [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this block may be rewritten with the `?` operator [INFO] [stdout] --> src/gpx_parser.rs:100:5 [INFO] [stdout] | [INFO] [stdout] 100 | / if name.namespace.is_none() { [INFO] [stdout] 101 | | return None; [INFO] [stdout] 102 | | } [INFO] [stdout] | |_____^ help: replace it with: `name.namespace.as_ref()?;` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#question_mark [INFO] [stdout] = note: `#[warn(clippy::question_mark)]` on by default [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: you seem to be trying to use `match` for destructuring a single pattern. Consider using `if let` [INFO] [stdout] --> src/gpx_parser.rs:220:13 [INFO] [stdout] | [INFO] [stdout] 220 | / match start_time { [INFO] [stdout] 221 | | Err(_) => return Err(ParseError::XmlError), [INFO] [stdout] 222 | | _ => {} [INFO] [stdout] 223 | | } [INFO] [stdout] | |_____________^ help: try: `if let Err(_) = start_time { return Err(ParseError::XmlError) }` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#single_match [INFO] [stdout] = note: `#[warn(clippy::single_match)]` on by default [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: length comparison to zero [INFO] [stdout] --> src/gpx_parser.rs:233:21 [INFO] [stdout] | [INFO] [stdout] 233 | if (context.current_segment.points.len() > 0) [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: using `!is_empty` is clearer and more explicit: `!context.current_segment.points.is_empty()` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#len_zero [INFO] [stdout] = note: `#[warn(clippy::len_zero)]` on by default [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: consider using `sort_by_key` [INFO] [stdout] --> src/gpx_parser.rs:275:17 [INFO] [stdout] | [INFO] [stdout] 275 | / context [INFO] [stdout] 276 | | .current_segment [INFO] [stdout] 277 | | .points [INFO] [stdout] 278 | | .sort_by(|a, b| a.time.cmp(&b.time)); [INFO] [stdout] | |________________________________________________________^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#unnecessary_sort_by [INFO] [stdout] = note: `#[warn(clippy::unnecessary_sort_by)]` on by default [INFO] [stdout] help: try [INFO] [stdout] | [INFO] [stdout] 278 - .sort_by(|a, b| a.time.cmp(&b.time)); [INFO] [stdout] 278 + .sort_by_key(|a| a.time); [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this block may be rewritten with the `?` operator [INFO] [stdout] --> src/gpx_parser.rs:308:17 [INFO] [stdout] | [INFO] [stdout] 308 | / if let Err(err) = parse_start_xml_element(tag, &attributes, &mut context) { [INFO] [stdout] 309 | | return Err(err); [INFO] [stdout] 310 | | } [INFO] [stdout] | |_________________^ help: replace it with: `parse_start_xml_element(tag, &attributes, &mut context)?` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#question_mark [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this block may be rewritten with the `?` operator [INFO] [stdout] --> src/gpx_parser.rs:322:17 [INFO] [stdout] | [INFO] [stdout] 322 | / if let Err(err) = parse_xml_characters(characters, &mut track, &mut context) { [INFO] [stdout] 323 | | return Err(err); [INFO] [stdout] 324 | | } [INFO] [stdout] | |_________________^ help: replace it with: `parse_xml_characters(characters, &mut track, &mut context)?` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#question_mark [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: returning the result of a `let` binding from a block [INFO] [stdout] --> src/stats.rs:60:5 [INFO] [stdout] | [INFO] [stdout] 59 | let hypot = (cathet1 * cathet1 + cathet2 * cathet2).sqrt(); [INFO] [stdout] | ----------------------------------------------------------- unnecessary `let` binding [INFO] [stdout] 60 | hypot [INFO] [stdout] | ^^^^^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#let_and_return [INFO] [stdout] = note: `#[warn(clippy::let_and_return)]` on by default [INFO] [stdout] help: return the expression directly [INFO] [stdout] | [INFO] [stdout] 59 ~ [INFO] [stdout] 60 ~ (cathet1 * cathet1 + cathet2 * cathet2).sqrt() [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: length comparison to zero [INFO] [stdout] --> src/stats.rs:101:8 [INFO] [stdout] | [INFO] [stdout] 101 | if points.len() == 0 { [INFO] [stdout] | ^^^^^^^^^^^^^^^^^ help: using `is_empty` is clearer and more explicit: `points.is_empty()` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#len_zero [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: manual checked division [INFO] [stdout] --> src/stats.rs:178:8 [INFO] [stdout] | [INFO] [stdout] 178 | if total_duration_sec != 0 { [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^ check performed here [INFO] [stdout] 179 | (sum / total_duration_sec) as u8 [INFO] [stdout] | -------------------------- division performed here [INFO] [stdout] | [INFO] [stdout] = help: consider using `checked_div` [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#manual_checked_ops [INFO] [stdout] = note: `#[warn(clippy::manual_checked_ops)]` on by default [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: unnecessary operation [INFO] [stdout] --> src/stats.rs:467:9 [INFO] [stdout] | [INFO] [stdout] 467 | [TrackPoint::new(); 2]; [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^ help: statement can be reduced to: `TrackPoint::new();` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#unnecessary_operation [INFO] [stdout] = note: `#[warn(clippy::unnecessary_operation)]` on by default [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: you should consider adding a `Default` implementation for `TrackPoint` [INFO] [stdout] --> src/lib.rs:38:5 [INFO] [stdout] | [INFO] [stdout] 38 | / pub fn new() -> TrackPoint { [INFO] [stdout] 39 | | TrackPoint { [INFO] [stdout] 40 | | latitude: 0.0, [INFO] [stdout] 41 | | longitude: 0.0, [INFO] [stdout] ... | [INFO] [stdout] 47 | | } [INFO] [stdout] | |_____^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#new_without_default [INFO] [stdout] = note: `#[warn(clippy::new_without_default)]` on by default [INFO] [stdout] help: try adding this [INFO] [stdout] | [INFO] [stdout] 37 + impl Default for TrackPoint { [INFO] [stdout] 38 + fn default() -> Self { [INFO] [stdout] 39 + Self::new() [INFO] [stdout] 40 + } [INFO] [stdout] 41 + } [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: you should consider adding a `Default` implementation for `TrackSegment` [INFO] [stdout] --> src/lib.rs:67:5 [INFO] [stdout] | [INFO] [stdout] 67 | / pub fn new() ->TrackSegment { [INFO] [stdout] 68 | | TrackSegment { points: Vec::new() } [INFO] [stdout] 69 | | } [INFO] [stdout] | |_____^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#new_without_default [INFO] [stdout] help: try adding this [INFO] [stdout] | [INFO] [stdout] 66 + impl Default for TrackSegment { [INFO] [stdout] 67 + fn default() -> Self { [INFO] [stdout] 68 + Self::new() [INFO] [stdout] 69 + } [INFO] [stdout] 70 + } [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: you should consider adding a `Default` implementation for `Track` [INFO] [stdout] --> src/lib.rs:80:5 [INFO] [stdout] | [INFO] [stdout] 80 | / pub fn new() -> Track { [INFO] [stdout] 81 | | Track { [INFO] [stdout] 82 | | name: String::new(), [INFO] [stdout] 83 | | creation_time: None, [INFO] [stdout] ... | [INFO] [stdout] 86 | | } [INFO] [stdout] | |_____^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#new_without_default [INFO] [stdout] help: try adding this [INFO] [stdout] | [INFO] [stdout] 79 + impl Default for Track { [INFO] [stdout] 80 + fn default() -> Self { [INFO] [stdout] 81 + Self::new() [INFO] [stdout] 82 + } [INFO] [stdout] 83 + } [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this expression creates a reference which is immediately dereferenced by the compiler [INFO] [stdout] --> src/lib.rs:97:46 [INFO] [stdout] | [INFO] [stdout] 97 | stats::calc_track_average_heart_rate(&self) [INFO] [stdout] | ^^^^^ help: change this to: `self` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_borrow [INFO] [stdout] = note: `#[warn(clippy::needless_borrow)]` on by default [INFO] [stdout] [INFO] [stdout] [INFO] [stderr] Finished `dev` profile [unoptimized + debuginfo] target(s) in 9.28s [INFO] running `Command { std: "docker" "inspect" "86df4cb328ce16d45149c71ba7e7822eae48bc948b1c31e833fd72b4ba4e2345", kill_on_drop: false }` [INFO] running `Command { std: "docker" "rm" "-f" "86df4cb328ce16d45149c71ba7e7822eae48bc948b1c31e833fd72b4ba4e2345", kill_on_drop: false }` [INFO] [stdout] 86df4cb328ce16d45149c71ba7e7822eae48bc948b1c31e833fd72b4ba4e2345