[INFO] crate settingsfile 0.2.5 is already in cache [INFO] extracting crate settingsfile 0.2.5 into work/ex/clippy-test-run/sources/stable/reg/settingsfile/0.2.5 [INFO] extracting crate settingsfile 0.2.5 into work/ex/clippy-test-run/sources/stable+rustflags=-Dclippy%3A%3Ainto_iter_on_array/reg/settingsfile/0.2.5 [INFO] validating manifest of settingsfile-0.2.5 on toolchain stable [INFO] running `"/mnt/big/crater/work/local/cargo-home/bin/cargo" "+stable" "read-manifest" "--manifest-path" "Cargo.toml"` [INFO] validating manifest of settingsfile-0.2.5 on toolchain stable+rustflags=-Dclippy::into_iter_on_array [INFO] running `"/mnt/big/crater/work/local/cargo-home/bin/cargo" "+stable" "read-manifest" "--manifest-path" "Cargo.toml"` [INFO] started frobbing settingsfile-0.2.5 [INFO] finished frobbing settingsfile-0.2.5 [INFO] frobbed toml for settingsfile-0.2.5 written to work/ex/clippy-test-run/sources/stable/reg/settingsfile/0.2.5/Cargo.toml [INFO] started frobbing settingsfile-0.2.5 [INFO] finished frobbing settingsfile-0.2.5 [INFO] frobbed toml for settingsfile-0.2.5 written to work/ex/clippy-test-run/sources/stable+rustflags=-Dclippy%3A%3Ainto_iter_on_array/reg/settingsfile/0.2.5/Cargo.toml [INFO] running `"/mnt/big/crater/work/local/cargo-home/bin/cargo" "+stable" "generate-lockfile" "--manifest-path" "Cargo.toml" "-Zno-index-update"` [INFO] running `"/mnt/big/crater/work/local/cargo-home/bin/cargo" "+stable" "generate-lockfile" "--manifest-path" "Cargo.toml" "-Zno-index-update"` [INFO] running `"/mnt/big/crater/work/local/cargo-home/bin/cargo" "+stable" "fetch" "--locked" "--manifest-path" "Cargo.toml"` [INFO] running `"/mnt/big/crater/work/local/cargo-home/bin/cargo" "+stable" "fetch" "--locked" "--manifest-path" "Cargo.toml"` [INFO] linting settingsfile-0.2.5 against stable for clippy-test-run [INFO] running `"docker" "create" "-v" "/mnt/big/crater/work/local/target-dirs/clippy-test-run/worker-3/stable:/opt/crater/target:rw,Z" "-v" "/mnt/big/crater/work/ex/clippy-test-run/sources/stable/reg/settingsfile/0.2.5:/opt/crater/workdir:ro,Z" "-v" "/mnt/big/crater/work/local/cargo-home:/opt/crater/cargo-home:ro,Z" "-v" "/mnt/big/crater/work/local/rustup-home:/opt/crater/rustup-home:ro,Z" "-e" "USER_ID=1000" "-e" "SOURCE_DIR=/opt/crater/workdir" "-e" "MAP_USER_ID=1000" "-e" "CARGO_TARGET_DIR=/opt/crater/target" "-e" "CARGO_INCREMENTAL=0" "-e" "RUST_BACKTRACE=full" "-e" "RUSTFLAGS=--cap-lints=forbid" "-e" "CARGO_HOME=/opt/crater/cargo-home" "-e" "RUSTUP_HOME=/opt/crater/rustup-home" "-w" "/opt/crater/workdir" "-m" "1536M" "--network" "none" "rustops/crates-build-env" "/opt/crater/cargo-home/bin/cargo" "+stable" "clippy" "--frozen" "--all" "--all-targets"` [INFO] [stdout] 949f7af429c72b71847c00f89ed7345076d74d08fd521264d499c86cad155575 [INFO] running `"docker" "start" "-a" "949f7af429c72b71847c00f89ed7345076d74d08fd521264d499c86cad155575"` [INFO] [stderr] Checking serde v1.0.85 [INFO] [stderr] Checking ron v0.4.1 [INFO] [stderr] Checking settingsfile v0.2.5 (/opt/crater/workdir) [INFO] [stderr] warning: unneeded return statement [INFO] [stderr] --> src/traits/format.rs:255:17 [INFO] [stderr] | [INFO] [stderr] 255 | return path.display().to_string(); [INFO] [stderr] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: remove `return` as shown: `path.display().to_string()` [INFO] [stderr] | [INFO] [stderr] = note: #[warn(clippy::needless_return)] on by default [INFO] [stderr] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_return [INFO] [stderr] [INFO] [stderr] warning: unneeded return statement [INFO] [stderr] --> src/structs/settings.rs:244:27 [INFO] [stderr] | [INFO] [stderr] 244 | Err(error) => return Err(error), [INFO] [stderr] | ^^^^^^^^^^^^^^^^^ help: remove `return` as shown: `Err(error)` [INFO] [stderr] | [INFO] [stderr] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_return [INFO] [stderr] [INFO] [stderr] warning: unneeded return statement [INFO] [stderr] --> src/structs/settings.rs:303:9 [INFO] [stderr] | [INFO] [stderr] 303 | return Some(subtree.clone()); [INFO] [stderr] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: remove `return` as shown: `Some(subtree.clone())` [INFO] [stderr] | [INFO] [stderr] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_return [INFO] [stderr] [INFO] [stderr] warning: useless use of `format!` [INFO] [stderr] --> src/traits/format.rs:188:26 [INFO] [stderr] | [INFO] [stderr] 188 | dir.push(format!("{}",self.folder())); [INFO] [stderr] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: consider using .to_string(): `self.folder().to_string()` [INFO] [stderr] | [INFO] [stderr] = note: #[warn(clippy::useless_format)] on by default [INFO] [stderr] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#useless_format [INFO] [stderr] = note: this error originates in a macro outside of the current crate (in Nightly builds, run with -Z external-macro-backtrace for more info) [INFO] [stderr] [INFO] [stderr] warning: Err(_) will match all errors, maybe not a good idea [INFO] [stderr] --> src/traits/format.rs:248:13 [INFO] [stderr] | [INFO] [stderr] 248 | Err(_) => { panic!(); }, [INFO] [stderr] | ^^^^^^ [INFO] [stderr] | [INFO] [stderr] = note: #[warn(clippy::match_wild_err_arm)] on by default [INFO] [stderr] = note: to remove this warning, match each error separately or use unreachable macro [INFO] [stderr] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#match_wild_err_arm [INFO] [stderr] [INFO] [stderr] warning: using `clone` on a `Copy` type [INFO] [stderr] --> src/traits/supportedtype.rs:33:43 [INFO] [stderr] | [INFO] [stderr] 33 | fn wrap(&self) -> Type { Type::Switch(self.clone()) } [INFO] [stderr] | ^^^^^^^^^^^^ help: try dereferencing it: `*self` [INFO] [stderr] | [INFO] [stderr] = note: #[warn(clippy::clone_on_copy)] on by default [INFO] [stderr] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#clone_on_copy [INFO] [stderr] [INFO] [stderr] warning: using `clone` on a `Copy` type [INFO] [stderr] --> src/traits/supportedtype.rs:37:40 [INFO] [stderr] | [INFO] [stderr] 37 | fn wrap(&self) -> Type { Type::Int(self.clone()) } [INFO] [stderr] | ^^^^^^^^^^^^ help: try dereferencing it: `*self` [INFO] [stderr] | [INFO] [stderr] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#clone_on_copy [INFO] [stderr] [INFO] [stderr] warning: using `clone` on a `Copy` type [INFO] [stderr] --> src/traits/supportedtype.rs:41:42 [INFO] [stderr] | [INFO] [stderr] 41 | fn wrap(&self) -> Type { Type::Float(self.clone()) } [INFO] [stderr] | ^^^^^^^^^^^^ help: try dereferencing it: `*self` [INFO] [stderr] | [INFO] [stderr] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#clone_on_copy [INFO] [stderr] [INFO] [stderr] warning: impl for `HashMap` should be generalized over different hashers [INFO] [stderr] --> src/traits/supportedtype.rs:44:24 [INFO] [stderr] | [INFO] [stderr] 44 | impl SupportedType for HashMap { [INFO] [stderr] | ^^^^^^^^^^^^^^^^^^^^ [INFO] [stderr] | [INFO] [stderr] = note: #[warn(clippy::implicit_hasher)] on by default [INFO] [stderr] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#implicit_hasher [INFO] [stderr] help: consider adding a type parameter [INFO] [stderr] | [INFO] [stderr] 44 | impl SupportedType for HashMap { [INFO] [stderr] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ ^^^^^^^^^^^^^^^^^^^^^^^^ [INFO] [stderr] [INFO] [stderr] warning: you don't need to add `&` to all patterns [INFO] [stderr] --> src/traits/supportedtype.rs:58:9 [INFO] [stderr] | [INFO] [stderr] 58 | / match *self { [INFO] [stderr] 59 | | &Type::Text(ref inner) => Type::Text(inner.clone()), [INFO] [stderr] 60 | | &Type::Switch(ref inner) => Type::Switch(inner.clone()), [INFO] [stderr] 61 | | &Type::Int(ref inner) => Type::Int(inner.clone()), [INFO] [stderr] ... | [INFO] [stderr] 65 | | &Type::None => Type::None, [INFO] [stderr] 66 | | } [INFO] [stderr] | |_________^ [INFO] [stderr] | [INFO] [stderr] = note: #[warn(clippy::match_ref_pats)] on by default [INFO] [stderr] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#match_ref_pats [INFO] [stderr] help: instead of prefixing all patterns with `&`, you can dereference the expression [INFO] [stderr] | [INFO] [stderr] 58 | match *(*self) { [INFO] [stderr] 59 | Type::Text(ref inner) => Type::Text(inner.clone()), [INFO] [stderr] 60 | Type::Switch(ref inner) => Type::Switch(inner.clone()), [INFO] [stderr] 61 | Type::Int(ref inner) => Type::Int(inner.clone()), [INFO] [stderr] 62 | Type::Float(ref inner) => Type::Float(inner.clone()), [INFO] [stderr] 63 | Type::Array(ref inner) => Type::Array(inner.clone()), [INFO] [stderr] ... [INFO] [stderr] [INFO] [stderr] warning: using `clone` on a `Copy` type [INFO] [stderr] --> src/traits/supportedtype.rs:60:54 [INFO] [stderr] | [INFO] [stderr] 60 | &Type::Switch(ref inner) => Type::Switch(inner.clone()), [INFO] [stderr] | ^^^^^^^^^^^^^ help: try dereferencing it: `*inner` [INFO] [stderr] | [INFO] [stderr] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#clone_on_copy [INFO] [stderr] [INFO] [stderr] warning: using `clone` on a `Copy` type [INFO] [stderr] --> src/traits/supportedtype.rs:61:48 [INFO] [stderr] | [INFO] [stderr] 61 | &Type::Int(ref inner) => Type::Int(inner.clone()), [INFO] [stderr] | ^^^^^^^^^^^^^ help: try dereferencing it: `*inner` [INFO] [stderr] | [INFO] [stderr] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#clone_on_copy [INFO] [stderr] [INFO] [stderr] warning: using `clone` on a `Copy` type [INFO] [stderr] --> src/traits/supportedtype.rs:62:52 [INFO] [stderr] | [INFO] [stderr] 62 | &Type::Float(ref inner) => Type::Float(inner.clone()), [INFO] [stderr] | ^^^^^^^^^^^^^ help: try dereferencing it: `*inner` [INFO] [stderr] | [INFO] [stderr] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#clone_on_copy [INFO] [stderr] [INFO] [stderr] warning: length comparison to zero [INFO] [stderr] --> src/structs/settings.rs:168:12 [INFO] [stderr] | [INFO] [stderr] 168 | if buf.len() > 0 { [INFO] [stderr] | ^^^^^^^^^^^^^ help: using `is_empty` is clearer and more explicit: `!buf.is_empty()` [INFO] [stderr] | [INFO] [stderr] = note: #[warn(clippy::len_zero)] on by default [INFO] [stderr] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#len_zero [INFO] [stderr] [INFO] [stderr] warning: length comparison to zero [INFO] [stderr] --> src/structs/settings.rs:218:12 [INFO] [stderr] | [INFO] [stderr] 218 | if buf.len() > 0 { [INFO] [stderr] | ^^^^^^^^^^^^^ help: using `is_empty` is clearer and more explicit: `!buf.is_empty()` [INFO] [stderr] | [INFO] [stderr] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#len_zero [INFO] [stderr] [INFO] [stderr] warning: The function/method `save_to` doesn't need a mutable reference [INFO] [stderr] --> src/structs/settings.rs:237:22 [INFO] [stderr] | [INFO] [stderr] 237 | self.save_to(&mut file) [INFO] [stderr] | ^^^^^^^^^ [INFO] [stderr] | [INFO] [stderr] = note: #[warn(clippy::unnecessary_mut_passed)] on by default [INFO] [stderr] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#unnecessary_mut_passed [INFO] [stderr] [INFO] [stderr] warning: single-character string constant used as pattern [INFO] [stderr] --> src/structs/settings.rs:281:52 [INFO] [stderr] | [INFO] [stderr] 281 | let path_tree : Vec<&str> = key_path.split(".").collect(); [INFO] [stderr] | ^^^ help: try using a char instead: `'.'` [INFO] [stderr] | [INFO] [stderr] = note: #[warn(clippy::single_char_pattern)] on by default [INFO] [stderr] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#single_char_pattern [INFO] [stderr] [INFO] [stderr] warning: the loop variable `i` is used to index `path_tree` [INFO] [stderr] --> src/structs/settings.rs:286:18 [INFO] [stderr] | [INFO] [stderr] 286 | for i in 0..path_tree.len() { [INFO] [stderr] | ^^^^^^^^^^^^^^^^^^ [INFO] [stderr] | [INFO] [stderr] = note: #[warn(clippy::needless_range_loop)] on by default [INFO] [stderr] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_range_loop [INFO] [stderr] help: consider using an iterator [INFO] [stderr] | [INFO] [stderr] 286 | for (i, ) in path_tree.iter().enumerate() { [INFO] [stderr] | ^^^^^^^^^^^ ^^^^^^^^^^^^^^^^^^^^^^^^^^^^ [INFO] [stderr] [INFO] [stderr] warning: single-character string constant used as pattern [INFO] [stderr] --> src/structs/settings.rs:326:52 [INFO] [stderr] | [INFO] [stderr] 326 | let path_tree : Vec<&str> = key_path.split(".").collect(); [INFO] [stderr] | ^^^ help: try using a char instead: `'.'` [INFO] [stderr] | [INFO] [stderr] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#single_char_pattern [INFO] [stderr] [INFO] [stderr] warning: the loop variable `i` is used to index `path_tree` [INFO] [stderr] --> src/structs/settings.rs:331:18 [INFO] [stderr] | [INFO] [stderr] 331 | for i in 0..path_tree.len()-1 { [INFO] [stderr] | ^^^^^^^^^^^^^^^^^^^^ [INFO] [stderr] | [INFO] [stderr] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_range_loop [INFO] [stderr] help: consider using an iterator [INFO] [stderr] | [INFO] [stderr] 331 | for (i, ) in path_tree.iter().enumerate().take(path_tree.len()-1) { [INFO] [stderr] | ^^^^^^^^^^^ ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ [INFO] [stderr] [INFO] [stderr] warning: single-character string constant used as pattern [INFO] [stderr] --> src/structs/settings.rs:395:52 [INFO] [stderr] | [INFO] [stderr] 395 | let path_tree : Vec<&str> = key_path.split(".").collect(); [INFO] [stderr] | ^^^ help: try using a char instead: `'.'` [INFO] [stderr] | [INFO] [stderr] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#single_char_pattern [INFO] [stderr] [INFO] [stderr] warning: the loop variable `i` is used to index `path_tree` [INFO] [stderr] --> src/structs/settings.rs:398:18 [INFO] [stderr] | [INFO] [stderr] 398 | for i in 0..path_tree.len()-1 { [INFO] [stderr] | ^^^^^^^^^^^^^^^^^^^^ [INFO] [stderr] | [INFO] [stderr] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_range_loop [INFO] [stderr] help: consider using an iterator [INFO] [stderr] | [INFO] [stderr] 398 | for (i, ) in path_tree.iter().enumerate().take(path_tree.len()-1) { [INFO] [stderr] | ^^^^^^^^^^^ ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ [INFO] [stderr] [INFO] [stderr] warning: length comparison to zero [INFO] [stderr] --> src/structs/settings.rs:428:19 [INFO] [stderr] | [INFO] [stderr] 428 | } else if global.len() > 0 && path_tree.len() > 0 { [INFO] [stderr] | ^^^^^^^^^^^^^^^^ help: using `is_empty` is clearer and more explicit: `!global.is_empty()` [INFO] [stderr] | [INFO] [stderr] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#len_zero [INFO] [stderr] [INFO] [stderr] warning: length comparison to zero [INFO] [stderr] --> src/structs/settings.rs:428:39 [INFO] [stderr] | [INFO] [stderr] 428 | } else if global.len() > 0 && path_tree.len() > 0 { [INFO] [stderr] | ^^^^^^^^^^^^^^^^^^^ help: using `is_empty` is clearer and more explicit: `!path_tree.is_empty()` [INFO] [stderr] | [INFO] [stderr] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#len_zero [INFO] [stderr] [INFO] [stderr] warning: length comparison to zero [INFO] [stderr] --> src/structs/settings.rs:435:12 [INFO] [stderr] | [INFO] [stderr] 435 | if global.len() > 0 { [INFO] [stderr] | ^^^^^^^^^^^^^^^^ help: using `is_empty` is clearer and more explicit: `!global.is_empty()` [INFO] [stderr] | [INFO] [stderr] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#len_zero [INFO] [stderr] [INFO] [stderr] warning: redundant pattern matching, consider using `is_ok()` [INFO] [stderr] --> src/structs/settings.rs:447:9 [INFO] [stderr] | [INFO] [stderr] 447 | / match fs::remove_file(path){ [INFO] [stderr] 448 | | Err(_) => false, [INFO] [stderr] 449 | | Ok(_) => true, [INFO] [stderr] 450 | | } [INFO] [stderr] | |_________^ help: try this: `fs::remove_file(path).is_ok()` [INFO] [stderr] | [INFO] [stderr] = note: #[warn(clippy::redundant_pattern_matching)] on by default [INFO] [stderr] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#redundant_pattern_matching [INFO] [stderr] [INFO] [stderr] warning: this if-then-else expression returns a bool literal [INFO] [stderr] --> src/structs/settings.rs:511:9 [INFO] [stderr] | [INFO] [stderr] 511 | / if self.global.len() > 0 { [INFO] [stderr] 512 | | true [INFO] [stderr] 513 | | } else { [INFO] [stderr] 514 | | false [INFO] [stderr] 515 | | } [INFO] [stderr] | |_________^ help: you can reduce it to: `self.global.len() > 0` [INFO] [stderr] | [INFO] [stderr] = note: #[warn(clippy::needless_bool)] on by default [INFO] [stderr] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_bool [INFO] [stderr] [INFO] [stderr] warning: length comparison to zero [INFO] [stderr] --> src/structs/settings.rs:511:12 [INFO] [stderr] | [INFO] [stderr] 511 | if self.global.len() > 0 { [INFO] [stderr] | ^^^^^^^^^^^^^^^^^^^^^ help: using `is_empty` is clearer and more explicit: `!self.global.is_empty()` [INFO] [stderr] | [INFO] [stderr] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#len_zero [INFO] [stderr] [INFO] [stderr] warning: The function/method `::create_from` doesn't need a mutable reference [INFO] [stderr] --> src/structs/shadowsettings.rs:79:44 [INFO] [stderr] | [INFO] [stderr] 79 | global : Settings::create_from(&mut file,config.clone())?, [INFO] [stderr] | ^^^^^^^^^ [INFO] [stderr] | [INFO] [stderr] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#unnecessary_mut_passed [INFO] [stderr] [INFO] [stderr] warning: The function/method `save_global_to` doesn't need a mutable reference [INFO] [stderr] --> src/structs/shadowsettings.rs:160:29 [INFO] [stderr] | [INFO] [stderr] 160 | self.save_global_to(&mut file)?; [INFO] [stderr] | ^^^^^^^^^ [INFO] [stderr] | [INFO] [stderr] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#unnecessary_mut_passed [INFO] [stderr] [INFO] [stderr] warning: The function/method `save_local_to` doesn't need a mutable reference [INFO] [stderr] --> src/structs/shadowsettings.rs:166:32 [INFO] [stderr] | [INFO] [stderr] 166 | self.save_local_to(&mut local_file)?; [INFO] [stderr] | ^^^^^^^^^^^^^^^ [INFO] [stderr] | [INFO] [stderr] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#unnecessary_mut_passed [INFO] [stderr] [INFO] [stderr] warning: redundant pattern matching, consider using `is_ok()` [INFO] [stderr] --> src/structs/shadowsettings.rs:286:9 [INFO] [stderr] | [INFO] [stderr] 286 | / match fs::remove_file(self.ioconfig.get_local_path_and_filename()){ [INFO] [stderr] 287 | | Err(_) => false, [INFO] [stderr] 288 | | Ok(_) => true, [INFO] [stderr] 289 | | } [INFO] [stderr] | |_________^ help: try this: `fs::remove_file(self.ioconfig.get_local_path_and_filename()).is_ok()` [INFO] [stderr] | [INFO] [stderr] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#redundant_pattern_matching [INFO] [stderr] [INFO] [stderr] warning: you don't need to add `&` to all patterns [INFO] [stderr] --> src/structs/types.rs:31:37 [INFO] [stderr] | [INFO] [stderr] 31 | pub fn is_text(&self) -> bool { if let &Type::Text(_) = self { true } else { false } } [INFO] [stderr] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ [INFO] [stderr] | [INFO] [stderr] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#match_ref_pats [INFO] [stderr] help: instead of prefixing all patterns with `&`, you can dereference the expression [INFO] [stderr] | [INFO] [stderr] 31 | pub fn is_text(&self) -> bool { if let Type::Text(_) = *self { true } else { false } } [INFO] [stderr] | ^^^^^^^^^^^^^ ^^^^^ [INFO] [stderr] [INFO] [stderr] warning: you don't need to add `&` to all patterns [INFO] [stderr] --> src/structs/types.rs:32:39 [INFO] [stderr] | [INFO] [stderr] 32 | pub fn is_switch(&self) -> bool { if let &Type::Switch(_) = self { true } else { false } } [INFO] [stderr] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ [INFO] [stderr] | [INFO] [stderr] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#match_ref_pats [INFO] [stderr] help: instead of prefixing all patterns with `&`, you can dereference the expression [INFO] [stderr] | [INFO] [stderr] 32 | pub fn is_switch(&self) -> bool { if let Type::Switch(_) = *self { true } else { false } } [INFO] [stderr] | ^^^^^^^^^^^^^^^ ^^^^^ [INFO] [stderr] [INFO] [stderr] warning: you don't need to add `&` to all patterns [INFO] [stderr] --> src/structs/types.rs:33:36 [INFO] [stderr] | [INFO] [stderr] 33 | pub fn is_int(&self) -> bool { if let &Type::Int(_) = self { true } else { false } } [INFO] [stderr] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ [INFO] [stderr] | [INFO] [stderr] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#match_ref_pats [INFO] [stderr] help: instead of prefixing all patterns with `&`, you can dereference the expression [INFO] [stderr] | [INFO] [stderr] 33 | pub fn is_int(&self) -> bool { if let Type::Int(_) = *self { true } else { false } } [INFO] [stderr] | ^^^^^^^^^^^^ ^^^^^ [INFO] [stderr] [INFO] [stderr] warning: you don't need to add `&` to all patterns [INFO] [stderr] --> src/structs/types.rs:34:38 [INFO] [stderr] | [INFO] [stderr] 34 | pub fn is_float(&self) -> bool { if let &Type::Float(_) = self { true } else { false } } [INFO] [stderr] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ [INFO] [stderr] | [INFO] [stderr] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#match_ref_pats [INFO] [stderr] help: instead of prefixing all patterns with `&`, you can dereference the expression [INFO] [stderr] | [INFO] [stderr] 34 | pub fn is_float(&self) -> bool { if let Type::Float(_) = *self { true } else { false } } [INFO] [stderr] | ^^^^^^^^^^^^^^ ^^^^^ [INFO] [stderr] [INFO] [stderr] warning: you don't need to add `&` to all patterns [INFO] [stderr] --> src/structs/types.rs:35:40 [INFO] [stderr] | [INFO] [stderr] 35 | pub fn is_complex(&self) -> bool { if let &Type::Complex(_) = self { true } else { false } } [INFO] [stderr] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ [INFO] [stderr] | [INFO] [stderr] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#match_ref_pats [INFO] [stderr] help: instead of prefixing all patterns with `&`, you can dereference the expression [INFO] [stderr] | [INFO] [stderr] 35 | pub fn is_complex(&self) -> bool { if let Type::Complex(_) = *self { true } else { false } } [INFO] [stderr] | ^^^^^^^^^^^^^^^^ ^^^^^ [INFO] [stderr] [INFO] [stderr] warning: you don't need to add `&` to all patterns [INFO] [stderr] --> src/structs/types.rs:36:38 [INFO] [stderr] | [INFO] [stderr] 36 | pub fn is_array(&self) -> bool { if let &Type::Array(_) = self { true } else { false } } [INFO] [stderr] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ [INFO] [stderr] | [INFO] [stderr] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#match_ref_pats [INFO] [stderr] help: instead of prefixing all patterns with `&`, you can dereference the expression [INFO] [stderr] | [INFO] [stderr] 36 | pub fn is_array(&self) -> bool { if let Type::Array(_) = *self { true } else { false } } [INFO] [stderr] | ^^^^^^^^^^^^^^ ^^^^^ [INFO] [stderr] [INFO] [stderr] warning: you don't need to add `&` to all patterns [INFO] [stderr] --> src/structs/types.rs:37:37 [INFO] [stderr] | [INFO] [stderr] 37 | pub fn is_none(&self) -> bool { if let &Type::None = self { true } else { false } } [INFO] [stderr] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ [INFO] [stderr] | [INFO] [stderr] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#match_ref_pats [INFO] [stderr] help: instead of prefixing all patterns with `&`, you can dereference the expression [INFO] [stderr] | [INFO] [stderr] 37 | pub fn is_none(&self) -> bool { if let Type::None = *self { true } else { false } } [INFO] [stderr] | ^^^^^^^^^^ ^^^^^ [INFO] [stderr] [INFO] [stderr] warning: you don't need to add `&` to all patterns [INFO] [stderr] --> src/structs/types.rs:41:47 [INFO] [stderr] | [INFO] [stderr] 41 | pub fn to_text(&self) -> Option { if let &Type::Text(ref inner) = self { Some(inner.clone()) } else { None } } [INFO] [stderr] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ [INFO] [stderr] | [INFO] [stderr] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#match_ref_pats [INFO] [stderr] help: instead of prefixing all patterns with `&`, you can dereference the expression [INFO] [stderr] | [INFO] [stderr] 41 | pub fn to_text(&self) -> Option { if let Type::Text(ref inner) = *self { Some(inner.clone()) } else { None } } [INFO] [stderr] | ^^^^^^^^^^^^^^^^^^^^^ ^^^^^ [INFO] [stderr] [INFO] [stderr] warning: you don't need to add `&` to all patterns [INFO] [stderr] --> src/structs/types.rs:42:47 [INFO] [stderr] | [INFO] [stderr] 42 | pub fn to_switch(&self) -> Option { if let &Type::Switch(ref inner) = self { Some(inner.clone()) } else { None } } [INFO] [stderr] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ [INFO] [stderr] | [INFO] [stderr] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#match_ref_pats [INFO] [stderr] help: instead of prefixing all patterns with `&`, you can dereference the expression [INFO] [stderr] | [INFO] [stderr] 42 | pub fn to_switch(&self) -> Option { if let Type::Switch(ref inner) = *self { Some(inner.clone()) } else { None } } [INFO] [stderr] | ^^^^^^^^^^^^^^^^^^^^^^^ ^^^^^ [INFO] [stderr] [INFO] [stderr] warning: using `clone` on a `Copy` type [INFO] [stderr] --> src/structs/types.rs:42:93 [INFO] [stderr] | [INFO] [stderr] 42 | pub fn to_switch(&self) -> Option { if let &Type::Switch(ref inner) = self { Some(inner.clone()) } else { None } } [INFO] [stderr] | ^^^^^^^^^^^^^ help: try dereferencing it: `*inner` [INFO] [stderr] | [INFO] [stderr] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#clone_on_copy [INFO] [stderr] [INFO] [stderr] warning: you don't need to add `&` to all patterns [INFO] [stderr] --> src/structs/types.rs:43:43 [INFO] [stderr] | [INFO] [stderr] 43 | pub fn to_int(&self) -> Option { if let &Type::Int(ref inner) = self { Some(inner.clone()) } else { None } } [INFO] [stderr] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ [INFO] [stderr] | [INFO] [stderr] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#match_ref_pats [INFO] [stderr] help: instead of prefixing all patterns with `&`, you can dereference the expression [INFO] [stderr] | [INFO] [stderr] 43 | pub fn to_int(&self) -> Option { if let Type::Int(ref inner) = *self { Some(inner.clone()) } else { None } } [INFO] [stderr] | ^^^^^^^^^^^^^^^^^^^^ ^^^^^ [INFO] [stderr] [INFO] [stderr] warning: using `clone` on a `Copy` type [INFO] [stderr] --> src/structs/types.rs:43:86 [INFO] [stderr] | [INFO] [stderr] 43 | pub fn to_int(&self) -> Option { if let &Type::Int(ref inner) = self { Some(inner.clone()) } else { None } } [INFO] [stderr] | ^^^^^^^^^^^^^ help: try dereferencing it: `*inner` [INFO] [stderr] | [INFO] [stderr] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#clone_on_copy [INFO] [stderr] [INFO] [stderr] warning: you don't need to add `&` to all patterns [INFO] [stderr] --> src/structs/types.rs:44:45 [INFO] [stderr] | [INFO] [stderr] 44 | pub fn to_float(&self) -> Option { if let &Type::Float(ref inner) = self { Some(inner.clone()) } else { None } } [INFO] [stderr] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ [INFO] [stderr] | [INFO] [stderr] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#match_ref_pats [INFO] [stderr] help: instead of prefixing all patterns with `&`, you can dereference the expression [INFO] [stderr] | [INFO] [stderr] 44 | pub fn to_float(&self) -> Option { if let Type::Float(ref inner) = *self { Some(inner.clone()) } else { None } } [INFO] [stderr] | ^^^^^^^^^^^^^^^^^^^^^^ ^^^^^ [INFO] [stderr] [INFO] [stderr] warning: using `clone` on a `Copy` type [INFO] [stderr] --> src/structs/types.rs:44:90 [INFO] [stderr] | [INFO] [stderr] 44 | pub fn to_float(&self) -> Option { if let &Type::Float(ref inner) = self { Some(inner.clone()) } else { None } } [INFO] [stderr] | ^^^^^^^^^^^^^ help: try dereferencing it: `*inner` [INFO] [stderr] | [INFO] [stderr] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#clone_on_copy [INFO] [stderr] [INFO] [stderr] warning: you don't need to add `&` to all patterns [INFO] [stderr] --> src/structs/types.rs:45:64 [INFO] [stderr] | [INFO] [stderr] 45 | pub fn to_complex(&self) -> Option> { if let &Type::Complex(ref inner) = self { Some(inner.clone()) } else { None } } [INFO] [stderr] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ [INFO] [stderr] | [INFO] [stderr] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#match_ref_pats [INFO] [stderr] help: instead of prefixing all patterns with `&`, you can dereference the expression [INFO] [stderr] | [INFO] [stderr] 45 | pub fn to_complex(&self) -> Option> { if let Type::Complex(ref inner) = *self { Some(inner.clone()) } else { None } } [INFO] [stderr] | ^^^^^^^^^^^^^^^^^^^^^^^^ ^^^^^ [INFO] [stderr] [INFO] [stderr] warning: you don't need to add `&` to all patterns [INFO] [stderr] --> src/structs/types.rs:46:51 [INFO] [stderr] | [INFO] [stderr] 46 | pub fn to_array(&self) -> Option> { if let &Type::Array(ref inner) = self { Some(inner.clone()) } else { None } } [INFO] [stderr] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ [INFO] [stderr] | [INFO] [stderr] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#match_ref_pats [INFO] [stderr] help: instead of prefixing all patterns with `&`, you can dereference the expression [INFO] [stderr] | [INFO] [stderr] 46 | pub fn to_array(&self) -> Option> { if let Type::Array(ref inner) = *self { Some(inner.clone()) } else { None } } [INFO] [stderr] | ^^^^^^^^^^^^^^^^^^^^^^ ^^^^^ [INFO] [stderr] [INFO] [stderr] warning: you don't need to add `&` to all patterns [INFO] [stderr] --> src/structs/types.rs:60:9 [INFO] [stderr] | [INFO] [stderr] 60 | / match self { [INFO] [stderr] 61 | | &Type::Text(ref text) => Type::Text(text.clone()), [INFO] [stderr] 62 | | &Type::Switch(ref boolean) => Type::Switch(boolean.clone()), [INFO] [stderr] 63 | | &Type::Int(ref int) => Type::Int(int.clone()), [INFO] [stderr] ... | [INFO] [stderr] 89 | | } [INFO] [stderr] 90 | | } [INFO] [stderr] | |_________^ [INFO] [stderr] | [INFO] [stderr] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#match_ref_pats [INFO] [stderr] help: instead of prefixing all patterns with `&`, you can dereference the expression [INFO] [stderr] | [INFO] [stderr] 60 | match *self { [INFO] [stderr] 61 | Type::Text(ref text) => Type::Text(text.clone()), [INFO] [stderr] 62 | Type::Switch(ref boolean) => Type::Switch(boolean.clone()), [INFO] [stderr] 63 | Type::Int(ref int) => Type::Int(int.clone()), [INFO] [stderr] 64 | Type::Float(ref float) => Type::Float(float.clone()), [INFO] [stderr] 65 | Type::Array(ref array) => Type::Array(array.clone()), [INFO] [stderr] ... [INFO] [stderr] [INFO] [stderr] warning: using `clone` on a `Copy` type [INFO] [stderr] --> src/structs/types.rs:62:56 [INFO] [stderr] | [INFO] [stderr] 62 | &Type::Switch(ref boolean) => Type::Switch(boolean.clone()), [INFO] [stderr] | ^^^^^^^^^^^^^^^ help: try dereferencing it: `*boolean` [INFO] [stderr] | [INFO] [stderr] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#clone_on_copy [INFO] [stderr] [INFO] [stderr] warning: using `clone` on a `Copy` type [INFO] [stderr] --> src/structs/types.rs:63:46 [INFO] [stderr] | [INFO] [stderr] 63 | &Type::Int(ref int) => Type::Int(int.clone()), [INFO] [stderr] | ^^^^^^^^^^^ help: try dereferencing it: `*int` [INFO] [stderr] | [INFO] [stderr] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#clone_on_copy [INFO] [stderr] [INFO] [stderr] warning: using `clone` on a `Copy` type [INFO] [stderr] --> src/structs/types.rs:64:52 [INFO] [stderr] | [INFO] [stderr] 64 | &Type::Float(ref float) => Type::Float(float.clone()), [INFO] [stderr] | ^^^^^^^^^^^^^ help: try dereferencing it: `*float` [INFO] [stderr] | [INFO] [stderr] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#clone_on_copy [INFO] [stderr] [INFO] [stderr] warning: unused `std::result::Result` that must be used [INFO] [stderr] --> src/structs/types.rs:103:17 [INFO] [stderr] | [INFO] [stderr] 103 | write!(f,"[ "); [INFO] [stderr] | ^^^^^^^^^^^^^^^ [INFO] [stderr] | [INFO] [stderr] = note: #[warn(unused_must_use)] on by default [INFO] [stderr] = note: this `Result` may be an `Err` variant, which should be handled [INFO] [stderr] = note: this error originates in a macro outside of the current crate (in Nightly builds, run with -Z external-macro-backtrace for more info) [INFO] [stderr] [INFO] [stderr] warning: unused `std::result::Result` that must be used [INFO] [stderr] --> src/structs/types.rs:105:21 [INFO] [stderr] | [INFO] [stderr] 105 | write!(f,"{}",value[i]); [INFO] [stderr] | ^^^^^^^^^^^^^^^^^^^^^^^^ [INFO] [stderr] | [INFO] [stderr] = note: this `Result` may be an `Err` variant, which should be handled [INFO] [stderr] = note: this error originates in a macro outside of the current crate (in Nightly builds, run with -Z external-macro-backtrace for more info) [INFO] [stderr] [INFO] [stderr] warning: unused `std::result::Result` that must be used [INFO] [stderr] --> src/structs/types.rs:107:25 [INFO] [stderr] | [INFO] [stderr] 107 | write!(f,", "); [INFO] [stderr] | ^^^^^^^^^^^^^^^ [INFO] [stderr] | [INFO] [stderr] = note: this `Result` may be an `Err` variant, which should be handled [INFO] [stderr] = note: this error originates in a macro outside of the current crate (in Nightly builds, run with -Z external-macro-backtrace for more info) [INFO] [stderr] [INFO] [stderr] warning: unused `std::result::Result` that must be used [INFO] [stderr] --> src/structs/types.rs:113:17 [INFO] [stderr] | [INFO] [stderr] 113 | write!(f,"{{ "); [INFO] [stderr] | ^^^^^^^^^^^^^^^^ [INFO] [stderr] | [INFO] [stderr] = note: this `Result` may be an `Err` variant, which should be handled [INFO] [stderr] = note: this error originates in a macro outside of the current crate (in Nightly builds, run with -Z external-macro-backtrace for more info) [INFO] [stderr] [INFO] [stderr] warning: unused `std::result::Result` that must be used [INFO] [stderr] --> src/structs/types.rs:115:21 [INFO] [stderr] | [INFO] [stderr] 115 | write!(f,"{} : {}, ", k,v); [INFO] [stderr] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^ [INFO] [stderr] | [INFO] [stderr] = note: this `Result` may be an `Err` variant, which should be handled [INFO] [stderr] = note: this error originates in a macro outside of the current crate (in Nightly builds, run with -Z external-macro-backtrace for more info) [INFO] [stderr] [INFO] [stderr] warning: unneeded return statement [INFO] [stderr] --> src/traits/format.rs:255:17 [INFO] [stderr] | [INFO] [stderr] 255 | return path.display().to_string(); [INFO] [stderr] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: remove `return` as shown: `path.display().to_string()` [INFO] [stderr] | [INFO] [stderr] = note: #[warn(clippy::needless_return)] on by default [INFO] [stderr] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_return [INFO] [stderr] [INFO] [stderr] warning: unneeded return statement [INFO] [stderr] --> src/structs/settings.rs:244:27 [INFO] [stderr] | [INFO] [stderr] 244 | Err(error) => return Err(error), [INFO] [stderr] | ^^^^^^^^^^^^^^^^^ help: remove `return` as shown: `Err(error)` [INFO] [stderr] | [INFO] [stderr] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_return [INFO] [stderr] [INFO] [stderr] warning: unneeded return statement [INFO] [stderr] --> src/structs/settings.rs:303:9 [INFO] [stderr] | [INFO] [stderr] 303 | return Some(subtree.clone()); [INFO] [stderr] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: remove `return` as shown: `Some(subtree.clone())` [INFO] [stderr] | [INFO] [stderr] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_return [INFO] [stderr] [INFO] [stderr] warning: useless use of `format!` [INFO] [stderr] --> src/traits/format.rs:188:26 [INFO] [stderr] | [INFO] [stderr] 188 | dir.push(format!("{}",self.folder())); [INFO] [stderr] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: consider using .to_string(): `self.folder().to_string()` [INFO] [stderr] | [INFO] [stderr] = note: #[warn(clippy::useless_format)] on by default [INFO] [stderr] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#useless_format [INFO] [stderr] = note: this error originates in a macro outside of the current crate (in Nightly builds, run with -Z external-macro-backtrace for more info) [INFO] [stderr] [INFO] [stderr] warning: Err(_) will match all errors, maybe not a good idea [INFO] [stderr] --> src/traits/format.rs:248:13 [INFO] [stderr] | [INFO] [stderr] 248 | Err(_) => { panic!(); }, [INFO] [stderr] | ^^^^^^ [INFO] [stderr] | [INFO] [stderr] = note: #[warn(clippy::match_wild_err_arm)] on by default [INFO] [stderr] = note: to remove this warning, match each error separately or use unreachable macro [INFO] [stderr] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#match_wild_err_arm [INFO] [stderr] [INFO] [stderr] warning: using `clone` on a `Copy` type [INFO] [stderr] --> src/traits/supportedtype.rs:33:43 [INFO] [stderr] | [INFO] [stderr] 33 | fn wrap(&self) -> Type { Type::Switch(self.clone()) } [INFO] [stderr] | ^^^^^^^^^^^^ help: try dereferencing it: `*self` [INFO] [stderr] | [INFO] [stderr] = note: #[warn(clippy::clone_on_copy)] on by default [INFO] [stderr] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#clone_on_copy [INFO] [stderr] [INFO] [stderr] warning: using `clone` on a `Copy` type [INFO] [stderr] --> src/traits/supportedtype.rs:37:40 [INFO] [stderr] | [INFO] [stderr] 37 | fn wrap(&self) -> Type { Type::Int(self.clone()) } [INFO] [stderr] | ^^^^^^^^^^^^ help: try dereferencing it: `*self` [INFO] [stderr] | [INFO] [stderr] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#clone_on_copy [INFO] [stderr] [INFO] [stderr] warning: using `clone` on a `Copy` type [INFO] [stderr] --> src/traits/supportedtype.rs:41:42 [INFO] [stderr] | [INFO] [stderr] 41 | fn wrap(&self) -> Type { Type::Float(self.clone()) } [INFO] [stderr] | ^^^^^^^^^^^^ help: try dereferencing it: `*self` [INFO] [stderr] | [INFO] [stderr] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#clone_on_copy [INFO] [stderr] [INFO] [stderr] warning: impl for `HashMap` should be generalized over different hashers [INFO] [stderr] --> src/traits/supportedtype.rs:44:24 [INFO] [stderr] | [INFO] [stderr] 44 | impl SupportedType for HashMap { [INFO] [stderr] | ^^^^^^^^^^^^^^^^^^^^ [INFO] [stderr] | [INFO] [stderr] = note: #[warn(clippy::implicit_hasher)] on by default [INFO] [stderr] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#implicit_hasher [INFO] [stderr] help: consider adding a type parameter [INFO] [stderr] | [INFO] [stderr] 44 | impl SupportedType for HashMap { [INFO] [stderr] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ ^^^^^^^^^^^^^^^^^^^^^^^^ [INFO] [stderr] [INFO] [stderr] warning: you don't need to add `&` to all patterns [INFO] [stderr] --> src/traits/supportedtype.rs:58:9 [INFO] [stderr] | [INFO] [stderr] 58 | / match *self { [INFO] [stderr] 59 | | &Type::Text(ref inner) => Type::Text(inner.clone()), [INFO] [stderr] 60 | | &Type::Switch(ref inner) => Type::Switch(inner.clone()), [INFO] [stderr] 61 | | &Type::Int(ref inner) => Type::Int(inner.clone()), [INFO] [stderr] ... | [INFO] [stderr] 65 | | &Type::None => Type::None, [INFO] [stderr] 66 | | } [INFO] [stderr] | |_________^ [INFO] [stderr] | [INFO] [stderr] = note: #[warn(clippy::match_ref_pats)] on by default [INFO] [stderr] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#match_ref_pats [INFO] [stderr] help: instead of prefixing all patterns with `&`, you can dereference the expression [INFO] [stderr] | [INFO] [stderr] 58 | match *(*self) { [INFO] [stderr] 59 | Type::Text(ref inner) => Type::Text(inner.clone()), [INFO] [stderr] 60 | Type::Switch(ref inner) => Type::Switch(inner.clone()), [INFO] [stderr] 61 | Type::Int(ref inner) => Type::Int(inner.clone()), [INFO] [stderr] 62 | Type::Float(ref inner) => Type::Float(inner.clone()), [INFO] [stderr] 63 | Type::Array(ref inner) => Type::Array(inner.clone()), [INFO] [stderr] ... [INFO] [stderr] [INFO] [stderr] warning: using `clone` on a `Copy` type [INFO] [stderr] --> src/traits/supportedtype.rs:60:54 [INFO] [stderr] | [INFO] [stderr] 60 | &Type::Switch(ref inner) => Type::Switch(inner.clone()), [INFO] [stderr] | ^^^^^^^^^^^^^ help: try dereferencing it: `*inner` [INFO] [stderr] | [INFO] [stderr] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#clone_on_copy [INFO] [stderr] [INFO] [stderr] warning: using `clone` on a `Copy` type [INFO] [stderr] --> src/traits/supportedtype.rs:61:48 [INFO] [stderr] | [INFO] [stderr] 61 | &Type::Int(ref inner) => Type::Int(inner.clone()), [INFO] [stderr] | ^^^^^^^^^^^^^ help: try dereferencing it: `*inner` [INFO] [stderr] | [INFO] [stderr] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#clone_on_copy [INFO] [stderr] [INFO] [stderr] warning: using `clone` on a `Copy` type [INFO] [stderr] --> src/traits/supportedtype.rs:62:52 [INFO] [stderr] | [INFO] [stderr] 62 | &Type::Float(ref inner) => Type::Float(inner.clone()), [INFO] [stderr] | ^^^^^^^^^^^^^ help: try dereferencing it: `*inner` [INFO] [stderr] | [INFO] [stderr] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#clone_on_copy [INFO] [stderr] [INFO] [stderr] warning: length comparison to zero [INFO] [stderr] --> src/structs/settings.rs:168:12 [INFO] [stderr] | [INFO] [stderr] 168 | if buf.len() > 0 { [INFO] [stderr] | ^^^^^^^^^^^^^ help: using `is_empty` is clearer and more explicit: `!buf.is_empty()` [INFO] [stderr] | [INFO] [stderr] = note: #[warn(clippy::len_zero)] on by default [INFO] [stderr] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#len_zero [INFO] [stderr] [INFO] [stderr] warning: length comparison to zero [INFO] [stderr] --> src/structs/settings.rs:218:12 [INFO] [stderr] | [INFO] [stderr] 218 | if buf.len() > 0 { [INFO] [stderr] | ^^^^^^^^^^^^^ help: using `is_empty` is clearer and more explicit: `!buf.is_empty()` [INFO] [stderr] | [INFO] [stderr] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#len_zero [INFO] [stderr] [INFO] [stderr] warning: The function/method `save_to` doesn't need a mutable reference [INFO] [stderr] --> src/structs/settings.rs:237:22 [INFO] [stderr] | [INFO] [stderr] 237 | self.save_to(&mut file) [INFO] [stderr] | ^^^^^^^^^ [INFO] [stderr] | [INFO] [stderr] = note: #[warn(clippy::unnecessary_mut_passed)] on by default [INFO] [stderr] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#unnecessary_mut_passed [INFO] [stderr] [INFO] [stderr] warning: single-character string constant used as pattern [INFO] [stderr] --> src/structs/settings.rs:281:52 [INFO] [stderr] | [INFO] [stderr] 281 | let path_tree : Vec<&str> = key_path.split(".").collect(); [INFO] [stderr] | ^^^ help: try using a char instead: `'.'` [INFO] [stderr] | [INFO] [stderr] = note: #[warn(clippy::single_char_pattern)] on by default [INFO] [stderr] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#single_char_pattern [INFO] [stderr] [INFO] [stderr] warning: the loop variable `i` is used to index `path_tree` [INFO] [stderr] --> src/structs/settings.rs:286:18 [INFO] [stderr] | [INFO] [stderr] 286 | for i in 0..path_tree.len() { [INFO] [stderr] | ^^^^^^^^^^^^^^^^^^ [INFO] [stderr] | [INFO] [stderr] = note: #[warn(clippy::needless_range_loop)] on by default [INFO] [stderr] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_range_loop [INFO] [stderr] help: consider using an iterator [INFO] [stderr] | [INFO] [stderr] 286 | for (i, ) in path_tree.iter().enumerate() { [INFO] [stderr] | ^^^^^^^^^^^ ^^^^^^^^^^^^^^^^^^^^^^^^^^^^ [INFO] [stderr] [INFO] [stderr] warning: single-character string constant used as pattern [INFO] [stderr] --> src/structs/settings.rs:326:52 [INFO] [stderr] | [INFO] [stderr] 326 | let path_tree : Vec<&str> = key_path.split(".").collect(); [INFO] [stderr] | ^^^ help: try using a char instead: `'.'` [INFO] [stderr] | [INFO] [stderr] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#single_char_pattern [INFO] [stderr] [INFO] [stderr] warning: the loop variable `i` is used to index `path_tree` [INFO] [stderr] --> src/structs/settings.rs:331:18 [INFO] [stderr] | [INFO] [stderr] 331 | for i in 0..path_tree.len()-1 { [INFO] [stderr] | ^^^^^^^^^^^^^^^^^^^^ [INFO] [stderr] | [INFO] [stderr] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_range_loop [INFO] [stderr] help: consider using an iterator [INFO] [stderr] | [INFO] [stderr] 331 | for (i, ) in path_tree.iter().enumerate().take(path_tree.len()-1) { [INFO] [stderr] | ^^^^^^^^^^^ ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ [INFO] [stderr] [INFO] [stderr] warning: single-character string constant used as pattern [INFO] [stderr] --> src/structs/settings.rs:395:52 [INFO] [stderr] | [INFO] [stderr] 395 | let path_tree : Vec<&str> = key_path.split(".").collect(); [INFO] [stderr] | ^^^ help: try using a char instead: `'.'` [INFO] [stderr] | [INFO] [stderr] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#single_char_pattern [INFO] [stderr] [INFO] [stderr] warning: the loop variable `i` is used to index `path_tree` [INFO] [stderr] --> src/structs/settings.rs:398:18 [INFO] [stderr] | [INFO] [stderr] 398 | for i in 0..path_tree.len()-1 { [INFO] [stderr] | ^^^^^^^^^^^^^^^^^^^^ [INFO] [stderr] | [INFO] [stderr] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_range_loop [INFO] [stderr] help: consider using an iterator [INFO] [stderr] | [INFO] [stderr] 398 | for (i, ) in path_tree.iter().enumerate().take(path_tree.len()-1) { [INFO] [stderr] | ^^^^^^^^^^^ ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ [INFO] [stderr] [INFO] [stderr] warning: length comparison to zero [INFO] [stderr] --> src/structs/settings.rs:428:19 [INFO] [stderr] | [INFO] [stderr] 428 | } else if global.len() > 0 && path_tree.len() > 0 { [INFO] [stderr] | ^^^^^^^^^^^^^^^^ help: using `is_empty` is clearer and more explicit: `!global.is_empty()` [INFO] [stderr] | [INFO] [stderr] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#len_zero [INFO] [stderr] [INFO] [stderr] warning: length comparison to zero [INFO] [stderr] --> src/structs/settings.rs:428:39 [INFO] [stderr] | [INFO] [stderr] 428 | } else if global.len() > 0 && path_tree.len() > 0 { [INFO] [stderr] | ^^^^^^^^^^^^^^^^^^^ help: using `is_empty` is clearer and more explicit: `!path_tree.is_empty()` [INFO] [stderr] | [INFO] [stderr] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#len_zero [INFO] [stderr] [INFO] [stderr] warning: length comparison to zero [INFO] [stderr] --> src/structs/settings.rs:435:12 [INFO] [stderr] | [INFO] [stderr] 435 | if global.len() > 0 { [INFO] [stderr] | ^^^^^^^^^^^^^^^^ help: using `is_empty` is clearer and more explicit: `!global.is_empty()` [INFO] [stderr] | [INFO] [stderr] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#len_zero [INFO] [stderr] [INFO] [stderr] warning: redundant pattern matching, consider using `is_ok()` [INFO] [stderr] --> src/structs/settings.rs:447:9 [INFO] [stderr] | [INFO] [stderr] 447 | / match fs::remove_file(path){ [INFO] [stderr] 448 | | Err(_) => false, [INFO] [stderr] 449 | | Ok(_) => true, [INFO] [stderr] 450 | | } [INFO] [stderr] | |_________^ help: try this: `fs::remove_file(path).is_ok()` [INFO] [stderr] | [INFO] [stderr] = note: #[warn(clippy::redundant_pattern_matching)] on by default [INFO] [stderr] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#redundant_pattern_matching [INFO] [stderr] [INFO] [stderr] warning: this if-then-else expression returns a bool literal [INFO] [stderr] --> src/structs/settings.rs:511:9 [INFO] [stderr] | [INFO] [stderr] 511 | / if self.global.len() > 0 { [INFO] [stderr] 512 | | true [INFO] [stderr] 513 | | } else { [INFO] [stderr] 514 | | false [INFO] [stderr] 515 | | } [INFO] [stderr] | |_________^ help: you can reduce it to: `self.global.len() > 0` [INFO] [stderr] | [INFO] [stderr] = note: #[warn(clippy::needless_bool)] on by default [INFO] [stderr] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_bool [INFO] [stderr] [INFO] [stderr] warning: length comparison to zero [INFO] [stderr] --> src/structs/settings.rs:511:12 [INFO] [stderr] | [INFO] [stderr] 511 | if self.global.len() > 0 { [INFO] [stderr] | ^^^^^^^^^^^^^^^^^^^^^ help: using `is_empty` is clearer and more explicit: `!self.global.is_empty()` [INFO] [stderr] | [INFO] [stderr] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#len_zero [INFO] [stderr] [INFO] [stderr] warning: equality checks against false can be replaced by a negation [INFO] [stderr] --> src/structs/settings.rs:683:17 [INFO] [stderr] | [INFO] [stderr] 683 | assert!(flat_gen.is_flat() == false); [INFO] [stderr] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: try simplifying it as shown: `!flat_gen.is_flat()` [INFO] [stderr] | [INFO] [stderr] = note: #[warn(clippy::bool_comparison)] on by default [INFO] [stderr] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#bool_comparison [INFO] [stderr] [INFO] [stderr] warning: equality checks against true are unnecessary [INFO] [stderr] --> src/structs/settings.rs:686:17 [INFO] [stderr] | [INFO] [stderr] 686 | assert!(flat.is_flat() == true); [INFO] [stderr] | ^^^^^^^^^^^^^^^^^^^^^^ help: try simplifying it as shown: `flat.is_flat()` [INFO] [stderr] | [INFO] [stderr] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#bool_comparison [INFO] [stderr] [INFO] [stderr] warning: equality checks against false can be replaced by a negation [INFO] [stderr] --> src/structs/settings.rs:694:17 [INFO] [stderr] | [INFO] [stderr] 694 | assert!(fluff.is_flat() == false); [INFO] [stderr] | ^^^^^^^^^^^^^^^^^^^^^^^^ help: try simplifying it as shown: `!fluff.is_flat()` [INFO] [stderr] | [INFO] [stderr] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#bool_comparison [INFO] [stderr] [INFO] [stderr] warning: The function/method `::create_from` doesn't need a mutable reference [INFO] [stderr] --> src/structs/shadowsettings.rs:79:44 [INFO] [stderr] | [INFO] [stderr] 79 | global : Settings::create_from(&mut file,config.clone())?, [INFO] [stderr] | ^^^^^^^^^ [INFO] [stderr] | [INFO] [stderr] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#unnecessary_mut_passed [INFO] [stderr] [INFO] [stderr] warning: The function/method `save_global_to` doesn't need a mutable reference [INFO] [stderr] --> src/structs/shadowsettings.rs:160:29 [INFO] [stderr] | [INFO] [stderr] 160 | self.save_global_to(&mut file)?; [INFO] [stderr] | ^^^^^^^^^ [INFO] [stderr] | [INFO] [stderr] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#unnecessary_mut_passed [INFO] [stderr] [INFO] [stderr] warning: The function/method `save_local_to` doesn't need a mutable reference [INFO] [stderr] --> src/structs/shadowsettings.rs:166:32 [INFO] [stderr] | [INFO] [stderr] 166 | self.save_local_to(&mut local_file)?; [INFO] [stderr] | ^^^^^^^^^^^^^^^ [INFO] [stderr] | [INFO] [stderr] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#unnecessary_mut_passed [INFO] [stderr] [INFO] [stderr] warning: redundant pattern matching, consider using `is_ok()` [INFO] [stderr] --> src/structs/shadowsettings.rs:286:9 [INFO] [stderr] | [INFO] [stderr] 286 | / match fs::remove_file(self.ioconfig.get_local_path_and_filename()){ [INFO] [stderr] 287 | | Err(_) => false, [INFO] [stderr] 288 | | Ok(_) => true, [INFO] [stderr] 289 | | } [INFO] [stderr] | |_________^ help: try this: `fs::remove_file(self.ioconfig.get_local_path_and_filename()).is_ok()` [INFO] [stderr] | [INFO] [stderr] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#redundant_pattern_matching [INFO] [stderr] [INFO] [stderr] warning: you don't need to add `&` to all patterns [INFO] [stderr] --> src/structs/types.rs:31:37 [INFO] [stderr] | [INFO] [stderr] 31 | pub fn is_text(&self) -> bool { if let &Type::Text(_) = self { true } else { false } } [INFO] [stderr] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ [INFO] [stderr] | [INFO] [stderr] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#match_ref_pats [INFO] [stderr] help: instead of prefixing all patterns with `&`, you can dereference the expression [INFO] [stderr] | [INFO] [stderr] 31 | pub fn is_text(&self) -> bool { if let Type::Text(_) = *self { true } else { false } } [INFO] [stderr] | ^^^^^^^^^^^^^ ^^^^^ [INFO] [stderr] [INFO] [stderr] warning: you don't need to add `&` to all patterns [INFO] [stderr] --> src/structs/types.rs:32:39 [INFO] [stderr] | [INFO] [stderr] 32 | pub fn is_switch(&self) -> bool { if let &Type::Switch(_) = self { true } else { false } } [INFO] [stderr] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ [INFO] [stderr] | [INFO] [stderr] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#match_ref_pats [INFO] [stderr] help: instead of prefixing all patterns with `&`, you can dereference the expression [INFO] [stderr] | [INFO] [stderr] 32 | pub fn is_switch(&self) -> bool { if let Type::Switch(_) = *self { true } else { false } } [INFO] [stderr] | ^^^^^^^^^^^^^^^ ^^^^^ [INFO] [stderr] [INFO] [stderr] warning: you don't need to add `&` to all patterns [INFO] [stderr] --> src/structs/types.rs:33:36 [INFO] [stderr] | [INFO] [stderr] 33 | pub fn is_int(&self) -> bool { if let &Type::Int(_) = self { true } else { false } } [INFO] [stderr] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ [INFO] [stderr] | [INFO] [stderr] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#match_ref_pats [INFO] [stderr] help: instead of prefixing all patterns with `&`, you can dereference the expression [INFO] [stderr] | [INFO] [stderr] 33 | pub fn is_int(&self) -> bool { if let Type::Int(_) = *self { true } else { false } } [INFO] [stderr] | ^^^^^^^^^^^^ ^^^^^ [INFO] [stderr] [INFO] [stderr] warning: you don't need to add `&` to all patterns [INFO] [stderr] --> src/structs/types.rs:34:38 [INFO] [stderr] | [INFO] [stderr] 34 | pub fn is_float(&self) -> bool { if let &Type::Float(_) = self { true } else { false } } [INFO] [stderr] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ [INFO] [stderr] | [INFO] [stderr] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#match_ref_pats [INFO] [stderr] help: instead of prefixing all patterns with `&`, you can dereference the expression [INFO] [stderr] | [INFO] [stderr] 34 | pub fn is_float(&self) -> bool { if let Type::Float(_) = *self { true } else { false } } [INFO] [stderr] | ^^^^^^^^^^^^^^ ^^^^^ [INFO] [stderr] [INFO] [stderr] warning: you don't need to add `&` to all patterns [INFO] [stderr] --> src/structs/types.rs:35:40 [INFO] [stderr] | [INFO] [stderr] 35 | pub fn is_complex(&self) -> bool { if let &Type::Complex(_) = self { true } else { false } } [INFO] [stderr] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ [INFO] [stderr] | [INFO] [stderr] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#match_ref_pats [INFO] [stderr] help: instead of prefixing all patterns with `&`, you can dereference the expression [INFO] [stderr] | [INFO] [stderr] 35 | pub fn is_complex(&self) -> bool { if let Type::Complex(_) = *self { true } else { false } } [INFO] [stderr] | ^^^^^^^^^^^^^^^^ ^^^^^ [INFO] [stderr] [INFO] [stderr] warning: you don't need to add `&` to all patterns [INFO] [stderr] --> src/structs/types.rs:36:38 [INFO] [stderr] | [INFO] [stderr] 36 | pub fn is_array(&self) -> bool { if let &Type::Array(_) = self { true } else { false } } [INFO] [stderr] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ [INFO] [stderr] | [INFO] [stderr] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#match_ref_pats [INFO] [stderr] help: instead of prefixing all patterns with `&`, you can dereference the expression [INFO] [stderr] | [INFO] [stderr] 36 | pub fn is_array(&self) -> bool { if let Type::Array(_) = *self { true } else { false } } [INFO] [stderr] | ^^^^^^^^^^^^^^ ^^^^^ [INFO] [stderr] [INFO] [stderr] warning: you don't need to add `&` to all patterns [INFO] [stderr] --> src/structs/types.rs:37:37 [INFO] [stderr] | [INFO] [stderr] 37 | pub fn is_none(&self) -> bool { if let &Type::None = self { true } else { false } } [INFO] [stderr] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ [INFO] [stderr] | [INFO] [stderr] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#match_ref_pats [INFO] [stderr] help: instead of prefixing all patterns with `&`, you can dereference the expression [INFO] [stderr] | [INFO] [stderr] 37 | pub fn is_none(&self) -> bool { if let Type::None = *self { true } else { false } } [INFO] [stderr] | ^^^^^^^^^^ ^^^^^ [INFO] [stderr] [INFO] [stderr] warning: you don't need to add `&` to all patterns [INFO] [stderr] --> src/structs/types.rs:41:47 [INFO] [stderr] | [INFO] [stderr] 41 | pub fn to_text(&self) -> Option { if let &Type::Text(ref inner) = self { Some(inner.clone()) } else { None } } [INFO] [stderr] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ [INFO] [stderr] | [INFO] [stderr] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#match_ref_pats [INFO] [stderr] help: instead of prefixing all patterns with `&`, you can dereference the expression [INFO] [stderr] | [INFO] [stderr] 41 | pub fn to_text(&self) -> Option { if let Type::Text(ref inner) = *self { Some(inner.clone()) } else { None } } [INFO] [stderr] | ^^^^^^^^^^^^^^^^^^^^^ ^^^^^ [INFO] [stderr] [INFO] [stderr] warning: you don't need to add `&` to all patterns [INFO] [stderr] --> src/structs/types.rs:42:47 [INFO] [stderr] | [INFO] [stderr] 42 | pub fn to_switch(&self) -> Option { if let &Type::Switch(ref inner) = self { Some(inner.clone()) } else { None } } [INFO] [stderr] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ [INFO] [stderr] | [INFO] [stderr] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#match_ref_pats [INFO] [stderr] help: instead of prefixing all patterns with `&`, you can dereference the expression [INFO] [stderr] | [INFO] [stderr] 42 | pub fn to_switch(&self) -> Option { if let Type::Switch(ref inner) = *self { Some(inner.clone()) } else { None } } [INFO] [stderr] | ^^^^^^^^^^^^^^^^^^^^^^^ ^^^^^ [INFO] [stderr] [INFO] [stderr] warning: using `clone` on a `Copy` type [INFO] [stderr] --> src/structs/types.rs:42:93 [INFO] [stderr] | [INFO] [stderr] 42 | pub fn to_switch(&self) -> Option { if let &Type::Switch(ref inner) = self { Some(inner.clone()) } else { None } } [INFO] [stderr] | ^^^^^^^^^^^^^ help: try dereferencing it: `*inner` [INFO] [stderr] | [INFO] [stderr] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#clone_on_copy [INFO] [stderr] [INFO] [stderr] warning: you don't need to add `&` to all patterns [INFO] [stderr] --> src/structs/types.rs:43:43 [INFO] [stderr] | [INFO] [stderr] 43 | pub fn to_int(&self) -> Option { if let &Type::Int(ref inner) = self { Some(inner.clone()) } else { None } } [INFO] [stderr] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ [INFO] [stderr] | [INFO] [stderr] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#match_ref_pats [INFO] [stderr] help: instead of prefixing all patterns with `&`, you can dereference the expression [INFO] [stderr] | [INFO] [stderr] 43 | pub fn to_int(&self) -> Option { if let Type::Int(ref inner) = *self { Some(inner.clone()) } else { None } } [INFO] [stderr] | ^^^^^^^^^^^^^^^^^^^^ ^^^^^ [INFO] [stderr] [INFO] [stderr] warning: using `clone` on a `Copy` type [INFO] [stderr] --> src/structs/types.rs:43:86 [INFO] [stderr] | [INFO] [stderr] 43 | pub fn to_int(&self) -> Option { if let &Type::Int(ref inner) = self { Some(inner.clone()) } else { None } } [INFO] [stderr] | ^^^^^^^^^^^^^ help: try dereferencing it: `*inner` [INFO] [stderr] | [INFO] [stderr] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#clone_on_copy [INFO] [stderr] [INFO] [stderr] warning: you don't need to add `&` to all patterns [INFO] [stderr] --> src/structs/types.rs:44:45 [INFO] [stderr] | [INFO] [stderr] 44 | pub fn to_float(&self) -> Option { if let &Type::Float(ref inner) = self { Some(inner.clone()) } else { None } } [INFO] [stderr] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ [INFO] [stderr] | [INFO] [stderr] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#match_ref_pats [INFO] [stderr] help: instead of prefixing all patterns with `&`, you can dereference the expression [INFO] [stderr] | [INFO] [stderr] 44 | pub fn to_float(&self) -> Option { if let Type::Float(ref inner) = *self { Some(inner.clone()) } else { None } } [INFO] [stderr] | ^^^^^^^^^^^^^^^^^^^^^^ ^^^^^ [INFO] [stderr] [INFO] [stderr] warning: using `clone` on a `Copy` type [INFO] [stderr] --> src/structs/types.rs:44:90 [INFO] [stderr] | [INFO] [stderr] 44 | pub fn to_float(&self) -> Option { if let &Type::Float(ref inner) = self { Some(inner.clone()) } else { None } } [INFO] [stderr] | ^^^^^^^^^^^^^ help: try dereferencing it: `*inner` [INFO] [stderr] | [INFO] [stderr] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#clone_on_copy [INFO] [stderr] [INFO] [stderr] warning: you don't need to add `&` to all patterns [INFO] [stderr] --> src/structs/types.rs:45:64 [INFO] [stderr] | [INFO] [stderr] 45 | pub fn to_complex(&self) -> Option> { if let &Type::Complex(ref inner) = self { Some(inner.clone()) } else { None } } [INFO] [stderr] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ [INFO] [stderr] | [INFO] [stderr] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#match_ref_pats [INFO] [stderr] help: instead of prefixing all patterns with `&`, you can dereference the expression [INFO] [stderr] | [INFO] [stderr] 45 | pub fn to_complex(&self) -> Option> { if let Type::Complex(ref inner) = *self { Some(inner.clone()) } else { None } } [INFO] [stderr] | ^^^^^^^^^^^^^^^^^^^^^^^^ ^^^^^ [INFO] [stderr] [INFO] [stderr] warning: you don't need to add `&` to all patterns [INFO] [stderr] --> src/structs/types.rs:46:51 [INFO] [stderr] | [INFO] [stderr] 46 | pub fn to_array(&self) -> Option> { if let &Type::Array(ref inner) = self { Some(inner.clone()) } else { None } } [INFO] [stderr] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ [INFO] [stderr] | [INFO] [stderr] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#match_ref_pats [INFO] [stderr] help: instead of prefixing all patterns with `&`, you can dereference the expression [INFO] [stderr] | [INFO] [stderr] 46 | pub fn to_array(&self) -> Option> { if let Type::Array(ref inner) = *self { Some(inner.clone()) } else { None } } [INFO] [stderr] | ^^^^^^^^^^^^^^^^^^^^^^ ^^^^^ [INFO] [stderr] [INFO] [stderr] warning: you don't need to add `&` to all patterns [INFO] [stderr] --> src/structs/types.rs:60:9 [INFO] [stderr] | [INFO] [stderr] 60 | / match self { [INFO] [stderr] 61 | | &Type::Text(ref text) => Type::Text(text.clone()), [INFO] [stderr] 62 | | &Type::Switch(ref boolean) => Type::Switch(boolean.clone()), [INFO] [stderr] 63 | | &Type::Int(ref int) => Type::Int(int.clone()), [INFO] [stderr] ... | [INFO] [stderr] 89 | | } [INFO] [stderr] 90 | | } [INFO] [stderr] | |_________^ [INFO] [stderr] | [INFO] [stderr] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#match_ref_pats [INFO] [stderr] help: instead of prefixing all patterns with `&`, you can dereference the expression [INFO] [stderr] | [INFO] [stderr] 60 | match *self { [INFO] [stderr] 61 | Type::Text(ref text) => Type::Text(text.clone()), [INFO] [stderr] 62 | Type::Switch(ref boolean) => Type::Switch(boolean.clone()), [INFO] [stderr] 63 | Type::Int(ref int) => Type::Int(int.clone()), [INFO] [stderr] 64 | Type::Float(ref float) => Type::Float(float.clone()), [INFO] [stderr] 65 | Type::Array(ref array) => Type::Array(array.clone()), [INFO] [stderr] ... [INFO] [stderr] [INFO] [stderr] warning: using `clone` on a `Copy` type [INFO] [stderr] --> src/structs/types.rs:62:56 [INFO] [stderr] | [INFO] [stderr] 62 | &Type::Switch(ref boolean) => Type::Switch(boolean.clone()), [INFO] [stderr] | ^^^^^^^^^^^^^^^ help: try dereferencing it: `*boolean` [INFO] [stderr] | [INFO] [stderr] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#clone_on_copy [INFO] [stderr] [INFO] [stderr] warning: using `clone` on a `Copy` type [INFO] [stderr] --> src/structs/types.rs:63:46 [INFO] [stderr] | [INFO] [stderr] 63 | &Type::Int(ref int) => Type::Int(int.clone()), [INFO] [stderr] | ^^^^^^^^^^^ help: try dereferencing it: `*int` [INFO] [stderr] | [INFO] [stderr] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#clone_on_copy [INFO] [stderr] [INFO] [stderr] warning: using `clone` on a `Copy` type [INFO] [stderr] --> src/structs/types.rs:64:52 [INFO] [stderr] | [INFO] [stderr] 64 | &Type::Float(ref float) => Type::Float(float.clone()), [INFO] [stderr] | ^^^^^^^^^^^^^ help: try dereferencing it: `*float` [INFO] [stderr] | [INFO] [stderr] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#clone_on_copy [INFO] [stderr] [INFO] [stderr] warning: unused `std::result::Result` that must be used [INFO] [stderr] --> src/structs/types.rs:103:17 [INFO] [stderr] | [INFO] [stderr] 103 | write!(f,"[ "); [INFO] [stderr] | ^^^^^^^^^^^^^^^ [INFO] [stderr] | [INFO] [stderr] = note: #[warn(unused_must_use)] on by default [INFO] [stderr] = note: this `Result` may be an `Err` variant, which should be handled [INFO] [stderr] = note: this error originates in a macro outside of the current crate (in Nightly builds, run with -Z external-macro-backtrace for more info) [INFO] [stderr] [INFO] [stderr] warning: unused `std::result::Result` that must be used [INFO] [stderr] --> src/structs/types.rs:105:21 [INFO] [stderr] | [INFO] [stderr] 105 | write!(f,"{}",value[i]); [INFO] [stderr] | ^^^^^^^^^^^^^^^^^^^^^^^^ [INFO] [stderr] | [INFO] [stderr] = note: this `Result` may be an `Err` variant, which should be handled [INFO] [stderr] = note: this error originates in a macro outside of the current crate (in Nightly builds, run with -Z external-macro-backtrace for more info) [INFO] [stderr] [INFO] [stderr] warning: unused `std::result::Result` that must be used [INFO] [stderr] --> src/structs/types.rs:107:25 [INFO] [stderr] | [INFO] [stderr] 107 | write!(f,", "); [INFO] [stderr] | ^^^^^^^^^^^^^^^ [INFO] [stderr] | [INFO] [stderr] = note: this `Result` may be an `Err` variant, which should be handled [INFO] [stderr] = note: this error originates in a macro outside of the current crate (in Nightly builds, run with -Z external-macro-backtrace for more info) [INFO] [stderr] [INFO] [stderr] warning: unused `std::result::Result` that must be used [INFO] [stderr] --> src/structs/types.rs:113:17 [INFO] [stderr] | [INFO] [stderr] 113 | write!(f,"{{ "); [INFO] [stderr] | ^^^^^^^^^^^^^^^^ [INFO] [stderr] | [INFO] [stderr] = note: this `Result` may be an `Err` variant, which should be handled [INFO] [stderr] = note: this error originates in a macro outside of the current crate (in Nightly builds, run with -Z external-macro-backtrace for more info) [INFO] [stderr] [INFO] [stderr] warning: unused `std::result::Result` that must be used [INFO] [stderr] --> src/structs/types.rs:115:21 [INFO] [stderr] | [INFO] [stderr] 115 | write!(f,"{} : {}, ", k,v); [INFO] [stderr] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^ [INFO] [stderr] | [INFO] [stderr] = note: this `Result` may be an `Err` variant, which should be handled [INFO] [stderr] = note: this error originates in a macro outside of the current crate (in Nightly builds, run with -Z external-macro-backtrace for more info) [INFO] [stderr] [INFO] [stderr] warning: called `.get().unwrap()` on a HashMap. Using `[]` is more clear and more concise [INFO] [stderr] --> src/structs/types.rs:149:17 [INFO] [stderr] | [INFO] [stderr] 149 | assert!(complex.to_complex().unwrap().get("b.a").unwrap().to_switch().unwrap()); [INFO] [stderr] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: try this: `&complex.to_complex().unwrap()["b.a"]` [INFO] [stderr] | [INFO] [stderr] = note: #[warn(clippy::get_unwrap)] on by default [INFO] [stderr] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#get_unwrap [INFO] [stderr] [INFO] [stderr] warning: called `.get().unwrap()` on a HashMap. Using `[]` is more clear and more concise [INFO] [stderr] --> src/structs/types.rs:151:17 [INFO] [stderr] | [INFO] [stderr] 151 | assert!(complex.to_complex().unwrap().get("b.int").unwrap().to_int().unwrap() == 10); [INFO] [stderr] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: try this: `&complex.to_complex().unwrap()["b.int"]` [INFO] [stderr] | [INFO] [stderr] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#get_unwrap [INFO] [stderr] [INFO] [stderr] error: strict comparison of f32 or f64 [INFO] [stderr] --> src/structs/types.rs:152:17 [INFO] [stderr] | [INFO] [stderr] 152 | assert!(complex.to_complex().unwrap().get("b.float").unwrap().to_float().unwrap() == 10.23); [INFO] [stderr] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: consider comparing them within some error: `(complex.to_complex().unwrap().get("b.float").unwrap().to_float().unwrap() - 10.23).abs() < error` [INFO] [stderr] | [INFO] [stderr] = note: #[deny(clippy::float_cmp)] on by default [INFO] [stderr] note: std::f32::EPSILON and std::f64::EPSILON are available. [INFO] [stderr] --> src/structs/types.rs:152:17 [INFO] [stderr] | [INFO] [stderr] 152 | assert!(complex.to_complex().unwrap().get("b.float").unwrap().to_float().unwrap() == 10.23); [INFO] [stderr] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ [INFO] [stderr] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#float_cmp [INFO] [stderr] [INFO] [stderr] warning: called `.get().unwrap()` on a HashMap. Using `[]` is more clear and more concise [INFO] [stderr] --> src/structs/types.rs:152:17 [INFO] [stderr] | [INFO] [stderr] 152 | assert!(complex.to_complex().unwrap().get("b.float").unwrap().to_float().unwrap() == 10.23); [INFO] [stderr] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: try this: `&complex.to_complex().unwrap()["b.float"]` [INFO] [stderr] | [INFO] [stderr] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#get_unwrap [INFO] [stderr] [INFO] [stderr] error: aborting due to previous error [INFO] [stderr] [INFO] [stderr] error: Could not compile `settingsfile`. [INFO] [stderr] warning: build failed, waiting for other jobs to finish... [INFO] [stderr] warning: The function/method `save_to` doesn't need a mutable reference [INFO] [stderr] --> tests/testing_with_ron.rs:61:26 [INFO] [stderr] | [INFO] [stderr] 61 | assert!(test.save_to(&mut tempfile).is_ok()); [INFO] [stderr] | ^^^^^^^^^^^^^ [INFO] [stderr] | [INFO] [stderr] = note: #[warn(clippy::unnecessary_mut_passed)] on by default [INFO] [stderr] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#unnecessary_mut_passed [INFO] [stderr] [INFO] [stderr] warning: The function/method `::create_from` doesn't need a mutable reference [INFO] [stderr] --> tests/testing_with_ron.rs:68:48 [INFO] [stderr] | [INFO] [stderr] 68 | let loaded_setting = Settings::create_from(&mut tempfile,Configuration{}).unwrap(); [INFO] [stderr] | ^^^^^^^^^^^^^ [INFO] [stderr] | [INFO] [stderr] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#unnecessary_mut_passed [INFO] [stderr] [INFO] [stderr] error: build failed [INFO] running `"docker" "inspect" "949f7af429c72b71847c00f89ed7345076d74d08fd521264d499c86cad155575"` [INFO] running `"docker" "rm" "-f" "949f7af429c72b71847c00f89ed7345076d74d08fd521264d499c86cad155575"` [INFO] [stdout] 949f7af429c72b71847c00f89ed7345076d74d08fd521264d499c86cad155575