[INFO] updating cached repository danielbusaba/affinity_new [INFO] running `"git" "fetch" "--all"` [INFO] [stdout] Fetching origin [INFO] [stderr] From git://github.com/danielbusaba/affinity_new [INFO] [stderr] * branch HEAD -> FETCH_HEAD [INFO] running `"git" "clone" "work/cache/sources/gh/danielbusaba/affinity_new" "work/ex/clippy-test-run/sources/stable/gh/danielbusaba/affinity_new"` [INFO] [stderr] Cloning into 'work/ex/clippy-test-run/sources/stable/gh/danielbusaba/affinity_new'... [INFO] [stderr] done. [INFO] running `"git" "clone" "work/cache/sources/gh/danielbusaba/affinity_new" "work/ex/clippy-test-run/sources/stable+rustflags=-Dclippy%3A%3Ainto_iter_on_array/gh/danielbusaba/affinity_new"` [INFO] [stderr] Cloning into 'work/ex/clippy-test-run/sources/stable+rustflags=-Dclippy%3A%3Ainto_iter_on_array/gh/danielbusaba/affinity_new'... [INFO] [stderr] done. [INFO] running `"git" "rev-parse" "HEAD"` [INFO] [stdout] f1aefd2bc322f4409be92e8f94f3d4163bbcc352 [INFO] sha for GitHub repo danielbusaba/affinity_new: f1aefd2bc322f4409be92e8f94f3d4163bbcc352 [INFO] validating manifest of danielbusaba/affinity_new 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 danielbusaba/affinity_new 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 danielbusaba/affinity_new [INFO] finished frobbing danielbusaba/affinity_new [INFO] frobbed toml for danielbusaba/affinity_new written to work/ex/clippy-test-run/sources/stable/gh/danielbusaba/affinity_new/Cargo.toml [INFO] started frobbing danielbusaba/affinity_new [INFO] finished frobbing danielbusaba/affinity_new [INFO] frobbed toml for danielbusaba/affinity_new written to work/ex/clippy-test-run/sources/stable+rustflags=-Dclippy%3A%3Ainto_iter_on_array/gh/danielbusaba/affinity_new/Cargo.toml [INFO] crate danielbusaba/affinity_new has a lockfile. skipping [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 danielbusaba/affinity_new against stable+rustflags=-Dclippy::into_iter_on_array for clippy-test-run [INFO] running `"docker" "create" "-v" "/mnt/big/crater/work/local/target-dirs/clippy-test-run/worker-3/stable+rustflags=-Dclippy%3A%3Ainto_iter_on_array:/opt/crater/target:rw,Z" "-v" "/mnt/big/crater/work/ex/clippy-test-run/sources/stable+rustflags=-Dclippy%3A%3Ainto_iter_on_array/gh/danielbusaba/affinity_new:/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 -Dclippy::into_iter_on_array" "-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] 68712ae4dcbc93c3dce596f9091712e1d790dd434a152e8c9e4ee32e18c91f50 [INFO] running `"docker" "start" "-a" "68712ae4dcbc93c3dce596f9091712e1d790dd434a152e8c9e4ee32e18c91f50"` [INFO] [stderr] Checking affinity_new v0.1.0 (/opt/crater/workdir) [INFO] [stderr] warning: literal with an empty format string [INFO] [stderr] --> src/main.rs:300:49 [INFO] [stderr] | [INFO] [stderr] 300 | println!("affinity{}({}, {}) = {}", 2, t.0, t.1, affinity); [INFO] [stderr] | ^ [INFO] [stderr] | [INFO] [stderr] = note: #[warn(clippy::print_literal)] on by default [INFO] [stderr] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#print_literal [INFO] [stderr] [INFO] [stderr] warning: literal with an empty format string [INFO] [stderr] --> src/main.rs:305:49 [INFO] [stderr] | [INFO] [stderr] 305 | println!("affinity{}({}, {}) = {}", 2, t.0, t.1, affinity); [INFO] [stderr] | ^ [INFO] [stderr] | [INFO] [stderr] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#print_literal [INFO] [stderr] [INFO] [stderr] warning: literal with an empty format string [INFO] [stderr] --> src/main.rs:300:49 [INFO] [stderr] | [INFO] [stderr] 300 | println!("affinity{}({}, {}) = {}", 2, t.0, t.1, affinity); [INFO] [stderr] | ^ [INFO] [stderr] | [INFO] [stderr] = note: #[warn(clippy::print_literal)] on by default [INFO] [stderr] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#print_literal [INFO] [stderr] [INFO] [stderr] warning: literal with an empty format string [INFO] [stderr] --> src/main.rs:305:49 [INFO] [stderr] | [INFO] [stderr] 305 | println!("affinity{}({}, {}) = {}", 2, t.0, t.1, affinity); [INFO] [stderr] | ^ [INFO] [stderr] | [INFO] [stderr] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#print_literal [INFO] [stderr] [INFO] [stderr] warning: unneeded return statement [INFO] [stderr] --> src/main.rs:70:5 [INFO] [stderr] | [INFO] [stderr] 70 | return trace; [INFO] [stderr] | ^^^^^^^^^^^^^ help: remove `return` as shown: `trace` [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: value assigned to `num` is never read [INFO] [stderr] --> src/main.rs:77:17 [INFO] [stderr] | [INFO] [stderr] 77 | let mut num = 0; [INFO] [stderr] | ^^^ [INFO] [stderr] | [INFO] [stderr] = note: #[warn(unused_assignments)] on by default [INFO] [stderr] [INFO] [stderr] warning: value assigned to `temp` is never read [INFO] [stderr] --> src/main.rs:121:17 [INFO] [stderr] | [INFO] [stderr] 121 | let mut temp = 0; [INFO] [stderr] | ^^^^ [INFO] [stderr] [INFO] [stderr] warning: value assigned to `temp` is never read [INFO] [stderr] --> src/main.rs:145:25 [INFO] [stderr] | [INFO] [stderr] 145 | let mut temp = 0; [INFO] [stderr] | ^^^^ [INFO] [stderr] [INFO] [stderr] warning: value assigned to `temp` is never read [INFO] [stderr] --> src/main.rs:194:25 [INFO] [stderr] | [INFO] [stderr] 194 | let mut temp = 0; [INFO] [stderr] | ^^^^ [INFO] [stderr] [INFO] [stderr] warning: value assigned to `temp` is never read [INFO] [stderr] --> src/main.rs:255:25 [INFO] [stderr] | [INFO] [stderr] 255 | let mut temp = 0; [INFO] [stderr] | ^^^^ [INFO] [stderr] [INFO] [stderr] warning: unneeded return statement [INFO] [stderr] --> src/main.rs:70:5 [INFO] [stderr] | [INFO] [stderr] 70 | return trace; [INFO] [stderr] | ^^^^^^^^^^^^^ help: remove `return` as shown: `trace` [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: writing `&Vec<_>` instead of `&[_]` involves one more reference and cannot be used with non-Vec-based slices. [INFO] [stderr] --> src/main.rs:73:20 [INFO] [stderr] | [INFO] [stderr] 73 | fn get_size(trace: &Vec, start: usize) -> usize //Inputs time window size [INFO] [stderr] | ^^^^^^^^^^ help: change this to: `&[char]` [INFO] [stderr] | [INFO] [stderr] = note: #[warn(clippy::ptr_arg)] on by default [INFO] [stderr] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#ptr_arg [INFO] [stderr] [INFO] [stderr] warning: writing `&Vec<_>` instead of `&[_]` involves one more reference and cannot be used with non-Vec-based slices. [INFO] [stderr] --> src/main.rs:112:24 [INFO] [stderr] | [INFO] [stderr] 112 | fn get_affinity(trace: &Vec, size: usize) //Finds all pair affinities given a trace and a time window, completes in n * m time (n is trace length, m is number of unique characters) [INFO] [stderr] | ^^^^^^^^^^ help: change this to: `&[char]` [INFO] [stderr] | [INFO] [stderr] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#ptr_arg [INFO] [stderr] [INFO] [stderr] warning: the function has a cyclomatic complexity of 29 [INFO] [stderr] --> src/main.rs:112:1 [INFO] [stderr] | [INFO] [stderr] 112 | / fn get_affinity(trace: &Vec, size: usize) //Finds all pair affinities given a trace and a time window, completes in n * m time (n is trace length, m is number of unique characters) [INFO] [stderr] 113 | | { [INFO] [stderr] 114 | | let mut single_frequencies: HashMap = HashMap::new(); //Stores the single frequencies of each unique trace character [INFO] [stderr] 115 | | let mut last_seen: HashMap = HashMap::new(); //Stores the last index a unique trace element was seen [INFO] [stderr] ... | [INFO] [stderr] 307 | | } [INFO] [stderr] 308 | | } [INFO] [stderr] | |_^ [INFO] [stderr] | [INFO] [stderr] = note: #[warn(clippy::cyclomatic_complexity)] on by default [INFO] [stderr] = help: you could split it up into multiple smaller functions [INFO] [stderr] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#cyclomatic_complexity [INFO] [stderr] [INFO] [stderr] warning: using `clone` on a `Copy` type [INFO] [stderr] --> src/main.rs:124:20 [INFO] [stderr] | [INFO] [stderr] 124 | temp = single_frequencies.get(&c).unwrap().clone(); //Retreives prior frequency [INFO] [stderr] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: try dereferencing it: `*single_frequencies.get(&c).unwrap()` [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: called `.get().unwrap()` on a HashMap. Using `[]` is more clear and more concise [INFO] [stderr] --> src/main.rs:124:20 [INFO] [stderr] | [INFO] [stderr] 124 | temp = single_frequencies.get(&c).unwrap().clone(); //Retreives prior frequency [INFO] [stderr] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: try this: `&single_frequencies[&c]` [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/main.rs:125:32 [INFO] [stderr] | [INFO] [stderr] 125 | let distance = i - last_seen.get(&c).unwrap(); //Finds the time between current and last sighting of the trace character [INFO] [stderr] | ^^^^^^^^^^^^^^^^^^^^^^^^^^ help: try this: `&last_seen[&c]` [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] warning: manual implementation of an assign operation [INFO] [stderr] --> src/main.rs:126:13 [INFO] [stderr] | [INFO] [stderr] 126 | temp = temp + distance; //Sets new single frequency to the time since last seen added to the prior frequency [INFO] [stderr] | ^^^^^^^^^^^^^^^^^^^^^^ help: replace it with: `temp += distance` [INFO] [stderr] | [INFO] [stderr] = note: #[warn(clippy::assign_op_pattern)] on by default [INFO] [stderr] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#assign_op_pattern [INFO] [stderr] [INFO] [stderr] warning: manual implementation of an assign operation [INFO] [stderr] --> src/main.rs:135:13 [INFO] [stderr] | [INFO] [stderr] 135 | temp = temp - 1; //Decrements single frequency by 1 [INFO] [stderr] | ^^^^^^^^^^^^^^^ help: replace it with: `temp -= 1` [INFO] [stderr] | [INFO] [stderr] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#assign_op_pattern [INFO] [stderr] [INFO] [stderr] warning: called `.get().unwrap()` on a HashMap. Using `[]` is more clear and more concise [INFO] [stderr] --> src/main.rs:142:32 [INFO] [stderr] | [INFO] [stderr] 142 | let distance = i - last_seen.get(j).unwrap(); //Finds the time between current time and the last time the trace sub-element was seen [INFO] [stderr] | ^^^^^^^^^^^^^^^^^^^^^^^^^ help: try this: `&last_seen[j]` [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] warning: called `.get().unwrap()` on a HashMap. Using `[]` is more clear and more concise [INFO] [stderr] --> src/main.rs:148:29 [INFO] [stderr] | [INFO] [stderr] 148 | temp = *joint_frequencies.get(&Tuple(c, *j)).unwrap(); //Retreives prior frequency [INFO] [stderr] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: try this: `&joint_frequencies[&Tuple(c, *j)]` [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] warning: called `.get().unwrap()` on a HashMap. Using `[]` is more clear and more concise [INFO] [stderr] --> src/main.rs:149:36 [INFO] [stderr] | [INFO] [stderr] 149 | let last = i - last_seen.get(&c).unwrap(); //Finds time between current time and last time the trace element was seen [INFO] [stderr] | ^^^^^^^^^^^^^^^^^^^^^^^^^^ help: try this: `&last_seen[&c]` [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] warning: manual implementation of an assign operation [INFO] [stderr] --> src/main.rs:153:25 [INFO] [stderr] | [INFO] [stderr] 153 | temp = temp - last; //Subtracts off the time between the current time and the last time the trace element was seen [INFO] [stderr] | ^^^^^^^^^^^^^^^^^^ help: replace it with: `temp -= last` [INFO] [stderr] | [INFO] [stderr] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#assign_op_pattern [INFO] [stderr] [INFO] [stderr] warning: the loop variable `i` is used to index `trace` [INFO] [stderr] --> src/main.rs:167:14 [INFO] [stderr] | [INFO] [stderr] 167 | for i in size .. trace.len() - size //Iterates from the end of the first time window to th beggining of the last time window [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] 167 | for (i, ) in trace.iter().enumerate().take(trace.len() - size).skip(size) //Iterates from the end of the first time window to th beggining of the last time window [INFO] [stderr] | ^^^^^^^^^^^ ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ [INFO] [stderr] [INFO] [stderr] warning: usage of `contains_key` followed by `insert` on a `HashMap` [INFO] [stderr] --> src/main.rs:170:9 [INFO] [stderr] | [INFO] [stderr] 170 | / if single_frequencies.contains_key(&c) //Checks if current character has been seen before [INFO] [stderr] 171 | | { [INFO] [stderr] 172 | | let mut temp = single_frequencies.get(&c).unwrap().clone(); //Retreives prior frequency [INFO] [stderr] 173 | | let distance = i - last_seen.get(&c).unwrap(); //Finds the time between current and last sighting of the trace character [INFO] [stderr] ... | [INFO] [stderr] 186 | | single_frequencies.insert(c, size); [INFO] [stderr] 187 | | } [INFO] [stderr] | |_________^ help: consider using: `single_frequencies.entry(c)` [INFO] [stderr] | [INFO] [stderr] = note: #[warn(clippy::map_entry)] on by default [INFO] [stderr] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#map_entry [INFO] [stderr] [INFO] [stderr] warning: using `clone` on a `Copy` type [INFO] [stderr] --> src/main.rs:172:28 [INFO] [stderr] | [INFO] [stderr] 172 | let mut temp = single_frequencies.get(&c).unwrap().clone(); //Retreives prior frequency [INFO] [stderr] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: try dereferencing it: `*single_frequencies.get(&c).unwrap()` [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: called `.get().unwrap()` on a HashMap. Using `[]` is more clear and more concise [INFO] [stderr] --> src/main.rs:172:28 [INFO] [stderr] | [INFO] [stderr] 172 | let mut temp = single_frequencies.get(&c).unwrap().clone(); //Retreives prior frequency [INFO] [stderr] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: try this: `&single_frequencies[&c]` [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] warning: called `.get().unwrap()` on a HashMap. Using `[]` is more clear and more concise [INFO] [stderr] --> src/main.rs:173:32 [INFO] [stderr] | [INFO] [stderr] 173 | let distance = i - last_seen.get(&c).unwrap(); //Finds the time between current and last sighting of the trace character [INFO] [stderr] | ^^^^^^^^^^^^^^^^^^^^^^^^^^ help: try this: `&last_seen[&c]` [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] warning: manual implementation of an assign operation [INFO] [stderr] --> src/main.rs:176:17 [INFO] [stderr] | [INFO] [stderr] 176 | temp = temp + size; //Adds the window size to the prior frequency [INFO] [stderr] | ^^^^^^^^^^^^^^^^^^ help: replace it with: `temp += size` [INFO] [stderr] | [INFO] [stderr] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#assign_op_pattern [INFO] [stderr] [INFO] [stderr] warning: manual implementation of an assign operation [INFO] [stderr] --> src/main.rs:180:17 [INFO] [stderr] | [INFO] [stderr] 180 | temp = temp + distance; [INFO] [stderr] | ^^^^^^^^^^^^^^^^^^^^^^ help: replace it with: `temp += distance` [INFO] [stderr] | [INFO] [stderr] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#assign_op_pattern [INFO] [stderr] [INFO] [stderr] warning: called `.get().unwrap()` on a HashMap. Using `[]` is more clear and more concise [INFO] [stderr] --> src/main.rs:191:32 [INFO] [stderr] | [INFO] [stderr] 191 | let distance = i - last_seen.get(j).unwrap(); //Finds the time between current time and the last time the trace sub-element was seen [INFO] [stderr] | ^^^^^^^^^^^^^^^^^^^^^^^^^ help: try this: `&last_seen[j]` [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] warning: called `.get().unwrap()` on a HashMap. Using `[]` is more clear and more concise [INFO] [stderr] --> src/main.rs:197:29 [INFO] [stderr] | [INFO] [stderr] 197 | temp = *joint_frequencies.get(&Tuple(c, *j)).unwrap(); //Retreives prior frequency [INFO] [stderr] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: try this: `&joint_frequencies[&Tuple(c, *j)]` [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] warning: called `.get().unwrap()` on a HashMap. Using `[]` is more clear and more concise [INFO] [stderr] --> src/main.rs:198:36 [INFO] [stderr] | [INFO] [stderr] 198 | let last = i - last_seen.get(&c).unwrap(); //Finds time between current time and last time the trace element was seen [INFO] [stderr] | ^^^^^^^^^^^^^^^^^^^^^^^^^^ help: try this: `&last_seen[&c]` [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] warning: manual implementation of an assign operation [INFO] [stderr] --> src/main.rs:202:25 [INFO] [stderr] | [INFO] [stderr] 202 | temp = temp - last; //Subtracts off the time between the current time and the last time the trace element was seen [INFO] [stderr] | ^^^^^^^^^^^^^^^^^^ help: replace it with: `temp -= last` [INFO] [stderr] | [INFO] [stderr] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#assign_op_pattern [INFO] [stderr] [INFO] [stderr] warning: usage of `contains_key` followed by `insert` on a `HashMap` [INFO] [stderr] --> src/main.rs:226:9 [INFO] [stderr] | [INFO] [stderr] 226 | / if single_frequencies.contains_key(&c) //Checks if current character has been seen before [INFO] [stderr] 227 | | { [INFO] [stderr] 228 | | let mut temp = single_frequencies.get(&c).unwrap().clone(); //Retreives prior frequency [INFO] [stderr] 229 | | let distance = i - last_seen.get(&c).unwrap(); //Finds the time between current and last sighting of the trace character [INFO] [stderr] ... | [INFO] [stderr] 247 | | single_frequencies.insert(c, index); [INFO] [stderr] 248 | | } [INFO] [stderr] | |_________^ help: consider using: `single_frequencies.entry(c)` [INFO] [stderr] | [INFO] [stderr] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#map_entry [INFO] [stderr] [INFO] [stderr] warning: using `clone` on a `Copy` type [INFO] [stderr] --> src/main.rs:228:28 [INFO] [stderr] | [INFO] [stderr] 228 | let mut temp = single_frequencies.get(&c).unwrap().clone(); //Retreives prior frequency [INFO] [stderr] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: try dereferencing it: `*single_frequencies.get(&c).unwrap()` [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: called `.get().unwrap()` on a HashMap. Using `[]` is more clear and more concise [INFO] [stderr] --> src/main.rs:228:28 [INFO] [stderr] | [INFO] [stderr] 228 | let mut temp = single_frequencies.get(&c).unwrap().clone(); //Retreives prior frequency [INFO] [stderr] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: try this: `&single_frequencies[&c]` [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] warning: called `.get().unwrap()` on a HashMap. Using `[]` is more clear and more concise [INFO] [stderr] --> src/main.rs:229:32 [INFO] [stderr] | [INFO] [stderr] 229 | let distance = i - last_seen.get(&c).unwrap(); //Finds the time between current and last sighting of the trace character [INFO] [stderr] | ^^^^^^^^^^^^^^^^^^^^^^^^^^ help: try this: `&last_seen[&c]` [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] warning: manual implementation of an assign operation [INFO] [stderr] --> src/main.rs:232:17 [INFO] [stderr] | [INFO] [stderr] 232 | temp = temp + index; //Adds the distance to the end of the trace to the prior frequency [INFO] [stderr] | ^^^^^^^^^^^^^^^^^^^ help: replace it with: `temp += index` [INFO] [stderr] | [INFO] [stderr] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#assign_op_pattern [INFO] [stderr] [INFO] [stderr] warning: manual implementation of an assign operation [INFO] [stderr] --> src/main.rs:236:17 [INFO] [stderr] | [INFO] [stderr] 236 | temp = temp + distance; [INFO] [stderr] | ^^^^^^^^^^^^^^^^^^^^^^ help: replace it with: `temp += distance` [INFO] [stderr] | [INFO] [stderr] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#assign_op_pattern [INFO] [stderr] [INFO] [stderr] warning: manual implementation of an assign operation [INFO] [stderr] --> src/main.rs:239:21 [INFO] [stderr] | [INFO] [stderr] 239 | temp = temp - 1; //Decrements the joint frequency by 1 [INFO] [stderr] | ^^^^^^^^^^^^^^^ help: replace it with: `temp -= 1` [INFO] [stderr] | [INFO] [stderr] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#assign_op_pattern [INFO] [stderr] [INFO] [stderr] warning: called `.get().unwrap()` on a HashMap. Using `[]` is more clear and more concise [INFO] [stderr] --> src/main.rs:252:32 [INFO] [stderr] | [INFO] [stderr] 252 | let distance = i - last_seen.get(j).unwrap(); //Finds the time between current time and the last time the trace sub-element was seen [INFO] [stderr] | ^^^^^^^^^^^^^^^^^^^^^^^^^ help: try this: `&last_seen[j]` [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] warning: called `.get().unwrap()` on a HashMap. Using `[]` is more clear and more concise [INFO] [stderr] --> src/main.rs:258:29 [INFO] [stderr] | [INFO] [stderr] 258 | temp = *joint_frequencies.get(&Tuple(c, *j)).unwrap(); //Finds time between current time and last time the trace element was seen [INFO] [stderr] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: try this: `&joint_frequencies[&Tuple(c, *j)]` [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] warning: called `.get().unwrap()` on a HashMap. Using `[]` is more clear and more concise [INFO] [stderr] --> src/main.rs:259:36 [INFO] [stderr] | [INFO] [stderr] 259 | let last = i - last_seen.get(&c).unwrap(); //Finds time between current time and last time the trace element was seen [INFO] [stderr] | ^^^^^^^^^^^^^^^^^^^^^^^^^^ help: try this: `&last_seen[&c]` [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] warning: manual implementation of an assign operation [INFO] [stderr] --> src/main.rs:264:25 [INFO] [stderr] | [INFO] [stderr] 264 | temp = temp - last; //Subtracts off the time between the current time and the last time the trace element was seen [INFO] [stderr] | ^^^^^^^^^^^^^^^^^^ help: replace it with: `temp -= last` [INFO] [stderr] | [INFO] [stderr] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#assign_op_pattern [INFO] [stderr] [INFO] [stderr] warning: manual implementation of an assign operation [INFO] [stderr] --> src/main.rs:269:25 [INFO] [stderr] | [INFO] [stderr] 269 | temp = temp - (size - index - 1); //Subtracts off the one less than the difference between the window size and the distance to the end of the trace [INFO] [stderr] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: replace it with: `temp -= (size - index - 1)` [INFO] [stderr] | [INFO] [stderr] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#assign_op_pattern [INFO] [stderr] [INFO] [stderr] warning: called `.get().unwrap()` on a HashMap. Using `[]` is more clear and more concise [INFO] [stderr] --> src/main.rs:285:31 [INFO] [stderr] | [INFO] [stderr] 285 | println!("{}: {}", k, single_frequencies.get(k).unwrap()); [INFO] [stderr] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: try this: `&single_frequencies[k]` [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] warning: called `.get().unwrap()` on a HashMap. Using `[]` is more clear and more concise [INFO] [stderr] --> src/main.rs:290:44 [INFO] [stderr] | [INFO] [stderr] 290 | println!("({}, {}): {}", t.0, t.1, joint_frequencies.get(t).unwrap()); [INFO] [stderr] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: try this: `&joint_frequencies[t]` [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] warning: called `.get().unwrap()` on a HashMap. Using `[]` is more clear and more concise [INFO] [stderr] --> src/main.rs:295:17 [INFO] [stderr] | [INFO] [stderr] 295 | let a = single_frequencies.get(&t.0).unwrap(); //Retreives single frequency for first character [INFO] [stderr] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: try this: `&single_frequencies[&t.0]` [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] warning: called `.get().unwrap()` on a HashMap. Using `[]` is more clear and more concise [INFO] [stderr] --> src/main.rs:296:17 [INFO] [stderr] | [INFO] [stderr] 296 | let b = single_frequencies.get(&t.1).unwrap(); //Retreives single frequency for second character [INFO] [stderr] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: try this: `&single_frequencies[&t.1]` [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] warning: called `.get().unwrap()` on a HashMap. Using `[]` is more clear and more concise [INFO] [stderr] --> src/main.rs:299:29 [INFO] [stderr] | [INFO] [stderr] 299 | let affinity = *joint_frequencies.get(t).unwrap() as f32 / *a as f32; //Sets affinity to the quotient of the joint frequency and the larger single frequency [INFO] [stderr] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: try this: `&joint_frequencies[t]` [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] warning: called `.get().unwrap()` on a HashMap. Using `[]` is more clear and more concise [INFO] [stderr] --> src/main.rs:304:29 [INFO] [stderr] | [INFO] [stderr] 304 | let affinity = *joint_frequencies.get(t).unwrap() as f32 / *b as f32; //Sets affinity to the quotient of the joint frequency and the larger single frequency [INFO] [stderr] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: try this: `&joint_frequencies[t]` [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] warning: value assigned to `num` is never read [INFO] [stderr] --> src/main.rs:77:17 [INFO] [stderr] | [INFO] [stderr] 77 | let mut num = 0; [INFO] [stderr] | ^^^ [INFO] [stderr] | [INFO] [stderr] = note: #[warn(unused_assignments)] on by default [INFO] [stderr] [INFO] [stderr] warning: value assigned to `temp` is never read [INFO] [stderr] --> src/main.rs:121:17 [INFO] [stderr] | [INFO] [stderr] 121 | let mut temp = 0; [INFO] [stderr] | ^^^^ [INFO] [stderr] [INFO] [stderr] warning: value assigned to `temp` is never read [INFO] [stderr] --> src/main.rs:145:25 [INFO] [stderr] | [INFO] [stderr] 145 | let mut temp = 0; [INFO] [stderr] | ^^^^ [INFO] [stderr] [INFO] [stderr] warning: value assigned to `temp` is never read [INFO] [stderr] --> src/main.rs:194:25 [INFO] [stderr] | [INFO] [stderr] 194 | let mut temp = 0; [INFO] [stderr] | ^^^^ [INFO] [stderr] [INFO] [stderr] warning: value assigned to `temp` is never read [INFO] [stderr] --> src/main.rs:255:25 [INFO] [stderr] | [INFO] [stderr] 255 | let mut temp = 0; [INFO] [stderr] | ^^^^ [INFO] [stderr] [INFO] [stderr] warning: writing `&Vec<_>` instead of `&[_]` involves one more reference and cannot be used with non-Vec-based slices. [INFO] [stderr] --> src/main.rs:73:20 [INFO] [stderr] | [INFO] [stderr] 73 | fn get_size(trace: &Vec, start: usize) -> usize //Inputs time window size [INFO] [stderr] | ^^^^^^^^^^ help: change this to: `&[char]` [INFO] [stderr] | [INFO] [stderr] = note: #[warn(clippy::ptr_arg)] on by default [INFO] [stderr] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#ptr_arg [INFO] [stderr] [INFO] [stderr] warning: writing `&Vec<_>` instead of `&[_]` involves one more reference and cannot be used with non-Vec-based slices. [INFO] [stderr] --> src/main.rs:112:24 [INFO] [stderr] | [INFO] [stderr] 112 | fn get_affinity(trace: &Vec, size: usize) //Finds all pair affinities given a trace and a time window, completes in n * m time (n is trace length, m is number of unique characters) [INFO] [stderr] | ^^^^^^^^^^ help: change this to: `&[char]` [INFO] [stderr] | [INFO] [stderr] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#ptr_arg [INFO] [stderr] [INFO] [stderr] warning: the function has a cyclomatic complexity of 29 [INFO] [stderr] --> src/main.rs:112:1 [INFO] [stderr] | [INFO] [stderr] 112 | / fn get_affinity(trace: &Vec, size: usize) //Finds all pair affinities given a trace and a time window, completes in n * m time (n is trace length, m is number of unique characters) [INFO] [stderr] 113 | | { [INFO] [stderr] 114 | | let mut single_frequencies: HashMap = HashMap::new(); //Stores the single frequencies of each unique trace character [INFO] [stderr] 115 | | let mut last_seen: HashMap = HashMap::new(); //Stores the last index a unique trace element was seen [INFO] [stderr] ... | [INFO] [stderr] 307 | | } [INFO] [stderr] 308 | | } [INFO] [stderr] | |_^ [INFO] [stderr] | [INFO] [stderr] = note: #[warn(clippy::cyclomatic_complexity)] on by default [INFO] [stderr] = help: you could split it up into multiple smaller functions [INFO] [stderr] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#cyclomatic_complexity [INFO] [stderr] [INFO] [stderr] warning: using `clone` on a `Copy` type [INFO] [stderr] --> src/main.rs:124:20 [INFO] [stderr] | [INFO] [stderr] 124 | temp = single_frequencies.get(&c).unwrap().clone(); //Retreives prior frequency [INFO] [stderr] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: try dereferencing it: `*single_frequencies.get(&c).unwrap()` [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: called `.get().unwrap()` on a HashMap. Using `[]` is more clear and more concise [INFO] [stderr] --> src/main.rs:124:20 [INFO] [stderr] | [INFO] [stderr] 124 | temp = single_frequencies.get(&c).unwrap().clone(); //Retreives prior frequency [INFO] [stderr] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: try this: `&single_frequencies[&c]` [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/main.rs:125:32 [INFO] [stderr] | [INFO] [stderr] 125 | let distance = i - last_seen.get(&c).unwrap(); //Finds the time between current and last sighting of the trace character [INFO] [stderr] | ^^^^^^^^^^^^^^^^^^^^^^^^^^ help: try this: `&last_seen[&c]` [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] warning: manual implementation of an assign operation [INFO] [stderr] --> src/main.rs:126:13 [INFO] [stderr] | [INFO] [stderr] 126 | temp = temp + distance; //Sets new single frequency to the time since last seen added to the prior frequency [INFO] [stderr] | ^^^^^^^^^^^^^^^^^^^^^^ help: replace it with: `temp += distance` [INFO] [stderr] | [INFO] [stderr] = note: #[warn(clippy::assign_op_pattern)] on by default [INFO] [stderr] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#assign_op_pattern [INFO] [stderr] [INFO] [stderr] warning: manual implementation of an assign operation [INFO] [stderr] --> src/main.rs:135:13 [INFO] [stderr] | [INFO] [stderr] 135 | temp = temp - 1; //Decrements single frequency by 1 [INFO] [stderr] | ^^^^^^^^^^^^^^^ help: replace it with: `temp -= 1` [INFO] [stderr] | [INFO] [stderr] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#assign_op_pattern [INFO] [stderr] [INFO] [stderr] warning: called `.get().unwrap()` on a HashMap. Using `[]` is more clear and more concise [INFO] [stderr] --> src/main.rs:142:32 [INFO] [stderr] | [INFO] [stderr] 142 | let distance = i - last_seen.get(j).unwrap(); //Finds the time between current time and the last time the trace sub-element was seen [INFO] [stderr] | ^^^^^^^^^^^^^^^^^^^^^^^^^ help: try this: `&last_seen[j]` [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] warning: called `.get().unwrap()` on a HashMap. Using `[]` is more clear and more concise [INFO] [stderr] --> src/main.rs:148:29 [INFO] [stderr] | [INFO] [stderr] 148 | temp = *joint_frequencies.get(&Tuple(c, *j)).unwrap(); //Retreives prior frequency [INFO] [stderr] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: try this: `&joint_frequencies[&Tuple(c, *j)]` [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] warning: called `.get().unwrap()` on a HashMap. Using `[]` is more clear and more concise [INFO] [stderr] --> src/main.rs:149:36 [INFO] [stderr] | [INFO] [stderr] 149 | let last = i - last_seen.get(&c).unwrap(); //Finds time between current time and last time the trace element was seen [INFO] [stderr] | ^^^^^^^^^^^^^^^^^^^^^^^^^^ help: try this: `&last_seen[&c]` [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] warning: manual implementation of an assign operation [INFO] [stderr] --> src/main.rs:153:25 [INFO] [stderr] | [INFO] [stderr] 153 | temp = temp - last; //Subtracts off the time between the current time and the last time the trace element was seen [INFO] [stderr] | ^^^^^^^^^^^^^^^^^^ help: replace it with: `temp -= last` [INFO] [stderr] | [INFO] [stderr] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#assign_op_pattern [INFO] [stderr] [INFO] [stderr] warning: the loop variable `i` is used to index `trace` [INFO] [stderr] --> src/main.rs:167:14 [INFO] [stderr] | [INFO] [stderr] 167 | for i in size .. trace.len() - size //Iterates from the end of the first time window to th beggining of the last time window [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] 167 | for (i, ) in trace.iter().enumerate().take(trace.len() - size).skip(size) //Iterates from the end of the first time window to th beggining of the last time window [INFO] [stderr] | ^^^^^^^^^^^ ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ [INFO] [stderr] [INFO] [stderr] warning: usage of `contains_key` followed by `insert` on a `HashMap` [INFO] [stderr] --> src/main.rs:170:9 [INFO] [stderr] | [INFO] [stderr] 170 | / if single_frequencies.contains_key(&c) //Checks if current character has been seen before [INFO] [stderr] 171 | | { [INFO] [stderr] 172 | | let mut temp = single_frequencies.get(&c).unwrap().clone(); //Retreives prior frequency [INFO] [stderr] 173 | | let distance = i - last_seen.get(&c).unwrap(); //Finds the time between current and last sighting of the trace character [INFO] [stderr] ... | [INFO] [stderr] 186 | | single_frequencies.insert(c, size); [INFO] [stderr] 187 | | } [INFO] [stderr] | |_________^ help: consider using: `single_frequencies.entry(c)` [INFO] [stderr] | [INFO] [stderr] = note: #[warn(clippy::map_entry)] on by default [INFO] [stderr] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#map_entry [INFO] [stderr] [INFO] [stderr] warning: using `clone` on a `Copy` type [INFO] [stderr] --> src/main.rs:172:28 [INFO] [stderr] | [INFO] [stderr] 172 | let mut temp = single_frequencies.get(&c).unwrap().clone(); //Retreives prior frequency [INFO] [stderr] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: try dereferencing it: `*single_frequencies.get(&c).unwrap()` [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: called `.get().unwrap()` on a HashMap. Using `[]` is more clear and more concise [INFO] [stderr] --> src/main.rs:172:28 [INFO] [stderr] | [INFO] [stderr] 172 | let mut temp = single_frequencies.get(&c).unwrap().clone(); //Retreives prior frequency [INFO] [stderr] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: try this: `&single_frequencies[&c]` [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] warning: called `.get().unwrap()` on a HashMap. Using `[]` is more clear and more concise [INFO] [stderr] --> src/main.rs:173:32 [INFO] [stderr] | [INFO] [stderr] 173 | let distance = i - last_seen.get(&c).unwrap(); //Finds the time between current and last sighting of the trace character [INFO] [stderr] | ^^^^^^^^^^^^^^^^^^^^^^^^^^ help: try this: `&last_seen[&c]` [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] warning: manual implementation of an assign operation [INFO] [stderr] --> src/main.rs:176:17 [INFO] [stderr] | [INFO] [stderr] 176 | temp = temp + size; //Adds the window size to the prior frequency [INFO] [stderr] | ^^^^^^^^^^^^^^^^^^ help: replace it with: `temp += size` [INFO] [stderr] | [INFO] [stderr] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#assign_op_pattern [INFO] [stderr] [INFO] [stderr] warning: manual implementation of an assign operation [INFO] [stderr] --> src/main.rs:180:17 [INFO] [stderr] | [INFO] [stderr] 180 | temp = temp + distance; [INFO] [stderr] | ^^^^^^^^^^^^^^^^^^^^^^ help: replace it with: `temp += distance` [INFO] [stderr] | [INFO] [stderr] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#assign_op_pattern [INFO] [stderr] [INFO] [stderr] warning: called `.get().unwrap()` on a HashMap. Using `[]` is more clear and more concise [INFO] [stderr] --> src/main.rs:191:32 [INFO] [stderr] | [INFO] [stderr] 191 | let distance = i - last_seen.get(j).unwrap(); //Finds the time between current time and the last time the trace sub-element was seen [INFO] [stderr] | ^^^^^^^^^^^^^^^^^^^^^^^^^ help: try this: `&last_seen[j]` [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] warning: called `.get().unwrap()` on a HashMap. Using `[]` is more clear and more concise [INFO] [stderr] --> src/main.rs:197:29 [INFO] [stderr] | [INFO] [stderr] 197 | temp = *joint_frequencies.get(&Tuple(c, *j)).unwrap(); //Retreives prior frequency [INFO] [stderr] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: try this: `&joint_frequencies[&Tuple(c, *j)]` [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] warning: called `.get().unwrap()` on a HashMap. Using `[]` is more clear and more concise [INFO] [stderr] --> src/main.rs:198:36 [INFO] [stderr] | [INFO] [stderr] 198 | let last = i - last_seen.get(&c).unwrap(); //Finds time between current time and last time the trace element was seen [INFO] [stderr] | ^^^^^^^^^^^^^^^^^^^^^^^^^^ help: try this: `&last_seen[&c]` [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] warning: manual implementation of an assign operation [INFO] [stderr] --> src/main.rs:202:25 [INFO] [stderr] | [INFO] [stderr] 202 | temp = temp - last; //Subtracts off the time between the current time and the last time the trace element was seen [INFO] [stderr] | ^^^^^^^^^^^^^^^^^^ help: replace it with: `temp -= last` [INFO] [stderr] | [INFO] [stderr] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#assign_op_pattern [INFO] [stderr] [INFO] [stderr] warning: usage of `contains_key` followed by `insert` on a `HashMap` [INFO] [stderr] --> src/main.rs:226:9 [INFO] [stderr] | [INFO] [stderr] 226 | / if single_frequencies.contains_key(&c) //Checks if current character has been seen before [INFO] [stderr] 227 | | { [INFO] [stderr] 228 | | let mut temp = single_frequencies.get(&c).unwrap().clone(); //Retreives prior frequency [INFO] [stderr] 229 | | let distance = i - last_seen.get(&c).unwrap(); //Finds the time between current and last sighting of the trace character [INFO] [stderr] ... | [INFO] [stderr] 247 | | single_frequencies.insert(c, index); [INFO] [stderr] 248 | | } [INFO] [stderr] | |_________^ help: consider using: `single_frequencies.entry(c)` [INFO] [stderr] | [INFO] [stderr] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#map_entry [INFO] [stderr] [INFO] [stderr] warning: using `clone` on a `Copy` type [INFO] [stderr] --> src/main.rs:228:28 [INFO] [stderr] | [INFO] [stderr] 228 | let mut temp = single_frequencies.get(&c).unwrap().clone(); //Retreives prior frequency [INFO] [stderr] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: try dereferencing it: `*single_frequencies.get(&c).unwrap()` [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: called `.get().unwrap()` on a HashMap. Using `[]` is more clear and more concise [INFO] [stderr] --> src/main.rs:228:28 [INFO] [stderr] | [INFO] [stderr] 228 | let mut temp = single_frequencies.get(&c).unwrap().clone(); //Retreives prior frequency [INFO] [stderr] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: try this: `&single_frequencies[&c]` [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] warning: called `.get().unwrap()` on a HashMap. Using `[]` is more clear and more concise [INFO] [stderr] --> src/main.rs:229:32 [INFO] [stderr] | [INFO] [stderr] 229 | let distance = i - last_seen.get(&c).unwrap(); //Finds the time between current and last sighting of the trace character [INFO] [stderr] | ^^^^^^^^^^^^^^^^^^^^^^^^^^ help: try this: `&last_seen[&c]` [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] warning: manual implementation of an assign operation [INFO] [stderr] --> src/main.rs:232:17 [INFO] [stderr] | [INFO] [stderr] 232 | temp = temp + index; //Adds the distance to the end of the trace to the prior frequency [INFO] [stderr] | ^^^^^^^^^^^^^^^^^^^ help: replace it with: `temp += index` [INFO] [stderr] | [INFO] [stderr] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#assign_op_pattern [INFO] [stderr] [INFO] [stderr] warning: manual implementation of an assign operation [INFO] [stderr] --> src/main.rs:236:17 [INFO] [stderr] | [INFO] [stderr] 236 | temp = temp + distance; [INFO] [stderr] | ^^^^^^^^^^^^^^^^^^^^^^ help: replace it with: `temp += distance` [INFO] [stderr] | [INFO] [stderr] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#assign_op_pattern [INFO] [stderr] [INFO] [stderr] warning: manual implementation of an assign operation [INFO] [stderr] --> src/main.rs:239:21 [INFO] [stderr] | [INFO] [stderr] 239 | temp = temp - 1; //Decrements the joint frequency by 1 [INFO] [stderr] | ^^^^^^^^^^^^^^^ help: replace it with: `temp -= 1` [INFO] [stderr] | [INFO] [stderr] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#assign_op_pattern [INFO] [stderr] [INFO] [stderr] warning: called `.get().unwrap()` on a HashMap. Using `[]` is more clear and more concise [INFO] [stderr] --> src/main.rs:252:32 [INFO] [stderr] | [INFO] [stderr] 252 | let distance = i - last_seen.get(j).unwrap(); //Finds the time between current time and the last time the trace sub-element was seen [INFO] [stderr] | ^^^^^^^^^^^^^^^^^^^^^^^^^ help: try this: `&last_seen[j]` [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] warning: called `.get().unwrap()` on a HashMap. Using `[]` is more clear and more concise [INFO] [stderr] --> src/main.rs:258:29 [INFO] [stderr] | [INFO] [stderr] 258 | temp = *joint_frequencies.get(&Tuple(c, *j)).unwrap(); //Finds time between current time and last time the trace element was seen [INFO] [stderr] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: try this: `&joint_frequencies[&Tuple(c, *j)]` [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] warning: called `.get().unwrap()` on a HashMap. Using `[]` is more clear and more concise [INFO] [stderr] --> src/main.rs:259:36 [INFO] [stderr] | [INFO] [stderr] 259 | let last = i - last_seen.get(&c).unwrap(); //Finds time between current time and last time the trace element was seen [INFO] [stderr] | ^^^^^^^^^^^^^^^^^^^^^^^^^^ help: try this: `&last_seen[&c]` [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] warning: manual implementation of an assign operation [INFO] [stderr] --> src/main.rs:264:25 [INFO] [stderr] | [INFO] [stderr] 264 | temp = temp - last; //Subtracts off the time between the current time and the last time the trace element was seen [INFO] [stderr] | ^^^^^^^^^^^^^^^^^^ help: replace it with: `temp -= last` [INFO] [stderr] | [INFO] [stderr] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#assign_op_pattern [INFO] [stderr] [INFO] [stderr] warning: manual implementation of an assign operation [INFO] [stderr] --> src/main.rs:269:25 [INFO] [stderr] | [INFO] [stderr] 269 | temp = temp - (size - index - 1); //Subtracts off the one less than the difference between the window size and the distance to the end of the trace [INFO] [stderr] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: replace it with: `temp -= (size - index - 1)` [INFO] [stderr] | [INFO] [stderr] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#assign_op_pattern [INFO] [stderr] [INFO] [stderr] warning: called `.get().unwrap()` on a HashMap. Using `[]` is more clear and more concise [INFO] [stderr] --> src/main.rs:285:31 [INFO] [stderr] | [INFO] [stderr] 285 | println!("{}: {}", k, single_frequencies.get(k).unwrap()); [INFO] [stderr] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: try this: `&single_frequencies[k]` [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] warning: called `.get().unwrap()` on a HashMap. Using `[]` is more clear and more concise [INFO] [stderr] --> src/main.rs:290:44 [INFO] [stderr] | [INFO] [stderr] 290 | println!("({}, {}): {}", t.0, t.1, joint_frequencies.get(t).unwrap()); [INFO] [stderr] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: try this: `&joint_frequencies[t]` [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] warning: called `.get().unwrap()` on a HashMap. Using `[]` is more clear and more concise [INFO] [stderr] --> src/main.rs:295:17 [INFO] [stderr] | [INFO] [stderr] 295 | let a = single_frequencies.get(&t.0).unwrap(); //Retreives single frequency for first character [INFO] [stderr] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: try this: `&single_frequencies[&t.0]` [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] warning: called `.get().unwrap()` on a HashMap. Using `[]` is more clear and more concise [INFO] [stderr] --> src/main.rs:296:17 [INFO] [stderr] | [INFO] [stderr] 296 | let b = single_frequencies.get(&t.1).unwrap(); //Retreives single frequency for second character [INFO] [stderr] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: try this: `&single_frequencies[&t.1]` [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] warning: called `.get().unwrap()` on a HashMap. Using `[]` is more clear and more concise [INFO] [stderr] --> src/main.rs:299:29 [INFO] [stderr] | [INFO] [stderr] 299 | let affinity = *joint_frequencies.get(t).unwrap() as f32 / *a as f32; //Sets affinity to the quotient of the joint frequency and the larger single frequency [INFO] [stderr] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: try this: `&joint_frequencies[t]` [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] warning: called `.get().unwrap()` on a HashMap. Using `[]` is more clear and more concise [INFO] [stderr] --> src/main.rs:304:29 [INFO] [stderr] | [INFO] [stderr] 304 | let affinity = *joint_frequencies.get(t).unwrap() as f32 / *b as f32; //Sets affinity to the quotient of the joint frequency and the larger single frequency [INFO] [stderr] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: try this: `&joint_frequencies[t]` [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] Finished dev [unoptimized + debuginfo] target(s) in 0.87s [INFO] running `"docker" "inspect" "68712ae4dcbc93c3dce596f9091712e1d790dd434a152e8c9e4ee32e18c91f50"` [INFO] running `"docker" "rm" "-f" "68712ae4dcbc93c3dce596f9091712e1d790dd434a152e8c9e4ee32e18c91f50"` [INFO] [stdout] 68712ae4dcbc93c3dce596f9091712e1d790dd434a152e8c9e4ee32e18c91f50