[INFO] cloning repository https://github.com/zawie/zdb [INFO] running `Command { std: "git" "-c" "credential.helper=" "-c" "credential.helper=/workspace/cargo-home/bin/git-credential-null" "clone" "--bare" "https://github.com/zawie/zdb" "/workspace/cache/git-repos/https%3A%2F%2Fgithub.com%2Fzawie%2Fzdb", kill_on_drop: false }` [INFO] [stderr] Cloning into bare repository '/workspace/cache/git-repos/https%3A%2F%2Fgithub.com%2Fzawie%2Fzdb'... [INFO] running `Command { std: "git" "rev-parse" "HEAD", kill_on_drop: false }` [INFO] [stdout] a163c4346b4f323e4f296f8bcaf27996b4e3a874 [INFO] linting zawie/zdb against nightly for clippy-nonminimal_bool-denied [INFO] running `Command { std: "git" "clone" "/workspace/cache/git-repos/https%3A%2F%2Fgithub.com%2Fzawie%2Fzdb" "/workspace/builds/worker-1-tc1/source", kill_on_drop: false }` [INFO] [stderr] Cloning into '/workspace/builds/worker-1-tc1/source'... [INFO] [stderr] done. [INFO] started tweaking git repo https://github.com/zawie/zdb [INFO] finished tweaking git repo https://github.com/zawie/zdb [INFO] tweaked toml for git repo https://github.com/zawie/zdb written to /workspace/builds/worker-1-tc1/source/Cargo.toml [INFO] validating manifest of git repo https://github.com/zawie/zdb on toolchain nightly [INFO] running `Command { std: CARGO_HOME="/workspace/cargo-home" RUSTUP_HOME="/workspace/rustup-home" "/workspace/cargo-home/bin/cargo" "+nightly" "metadata" "--manifest-path" "Cargo.toml" "--no-deps", kill_on_drop: false }` [INFO] crate git repo https://github.com/zawie/zdb already has a lockfile, it will not be regenerated [INFO] running `Command { std: CARGO_HOME="/workspace/cargo-home" RUSTUP_HOME="/workspace/rustup-home" "/workspace/cargo-home/bin/cargo" "+nightly" "fetch" "--manifest-path" "Cargo.toml", kill_on_drop: false }` [INFO] [stderr] warning: unused manifest key: cli [INFO] [stderr] Downloading crates ... [INFO] [stderr] Downloaded uuid v1.9.1 [INFO] running `Command { std: "docker" "create" "-v" "/var/lib/crater-agent-workspace/builds/worker-1-tc1/target:/opt/rustwide/target:rw,Z" "-v" "/var/lib/crater-agent-workspace/builds/worker-1-tc1/source:/opt/rustwide/workdir:ro,Z" "-v" "/var/lib/crater-agent-workspace/cargo-home:/opt/rustwide/cargo-home:ro,Z" "-v" "/var/lib/crater-agent-workspace/rustup-home:/opt/rustwide/rustup-home:ro,Z" "-e" "SOURCE_DIR=/opt/rustwide/workdir" "-e" "CARGO_TARGET_DIR=/opt/rustwide/target" "-e" "CARGO_HOME=/opt/rustwide/cargo-home" "-e" "RUSTUP_HOME=/opt/rustwide/rustup-home" "-w" "/opt/rustwide/workdir" "-m" "1610612736" "--user" "0:0" "--network" "none" "ghcr.io/rust-lang/crates-build-env/linux@sha256:d429b63d4308055ea97f60fb1d3dfca48854a00942f1bd2ad806beaf015945ec" "/opt/rustwide/cargo-home/bin/cargo" "+nightly" "metadata" "--no-deps" "--format-version=1", kill_on_drop: false }` [INFO] [stdout] 0c75d23c89dfca7bc91ebd777b1a0600813755a18c4831136e47b3c8d234525e [INFO] running `Command { std: "docker" "start" "-a" "0c75d23c89dfca7bc91ebd777b1a0600813755a18c4831136e47b3c8d234525e", kill_on_drop: false }` [INFO] running `Command { std: "docker" "inspect" "0c75d23c89dfca7bc91ebd777b1a0600813755a18c4831136e47b3c8d234525e", kill_on_drop: false }` [INFO] running `Command { std: "docker" "rm" "-f" "0c75d23c89dfca7bc91ebd777b1a0600813755a18c4831136e47b3c8d234525e", kill_on_drop: false }` [INFO] [stdout] 0c75d23c89dfca7bc91ebd777b1a0600813755a18c4831136e47b3c8d234525e [INFO] running `Command { std: "docker" "create" "-v" "/var/lib/crater-agent-workspace/builds/worker-1-tc1/target:/opt/rustwide/target:rw,Z" "-v" "/var/lib/crater-agent-workspace/builds/worker-1-tc1/source:/opt/rustwide/workdir:ro,Z" "-v" "/var/lib/crater-agent-workspace/cargo-home:/opt/rustwide/cargo-home:ro,Z" "-v" "/var/lib/crater-agent-workspace/rustup-home:/opt/rustwide/rustup-home:ro,Z" "-e" "SOURCE_DIR=/opt/rustwide/workdir" "-e" "CARGO_TARGET_DIR=/opt/rustwide/target" "-e" "CARGO_INCREMENTAL=0" "-e" "RUST_BACKTRACE=full" "-e" "RUSTFLAGS=--cap-lints=forbid" "-e" "RUSTDOCFLAGS=--cap-lints=forbid" "-e" "CARGO_HOME=/opt/rustwide/cargo-home" "-e" "RUSTUP_HOME=/opt/rustwide/rustup-home" "-w" "/opt/rustwide/workdir" "-m" "1610612736" "--user" "0:0" "--network" "none" "ghcr.io/rust-lang/crates-build-env/linux@sha256:d429b63d4308055ea97f60fb1d3dfca48854a00942f1bd2ad806beaf015945ec" "/opt/rustwide/cargo-home/bin/cargo" "+nightly" "clippy" "--frozen" "--all" "--all-targets" "--message-format=json", kill_on_drop: false }` [INFO] [stdout] 925163b0a327ecc06459abd4e376271ff7f18d8d6f2c993340c44fefe91cff8f [INFO] running `Command { std: "docker" "start" "-a" "925163b0a327ecc06459abd4e376271ff7f18d8d6f2c993340c44fefe91cff8f", kill_on_drop: false }` [INFO] [stderr] warning: unused manifest key: cli [INFO] [stderr] Compiling libc v0.2.155 [INFO] [stderr] Checking log v0.4.22 [INFO] [stderr] Checking getrandom v0.2.15 [INFO] [stderr] Checking rand_core v0.6.4 [INFO] [stderr] Checking uuid v1.9.1 [INFO] [stderr] Checking rand_chacha v0.3.1 [INFO] [stderr] Checking rand v0.8.5 [INFO] [stderr] Checking zdb v0.1.0 (/opt/rustwide/workdir) [INFO] [stdout] warning: redundant field names in struct initialization [INFO] [stdout] --> src/database.rs:42:13 [INFO] [stdout] | [INFO] [stdout] 42 | segments: segments, [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^ help: replace it with: `segments` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#redundant_field_names [INFO] [stdout] = note: `#[warn(clippy::redundant_field_names)]` on by default [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: redundant field names in struct initialization [INFO] [stdout] --> src/database.rs:43:13 [INFO] [stdout] | [INFO] [stdout] 43 | directory: directory, [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^ help: replace it with: `directory` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#redundant_field_names [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: redundant field names in struct initialization [INFO] [stdout] --> src/segment_store.rs:34:9 [INFO] [stdout] | [INFO] [stdout] 34 | file_path: file_path, [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^ help: replace it with: `file_path` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#redundant_field_names [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: redundant field names in struct initialization [INFO] [stdout] --> src/segment_store.rs:35:9 [INFO] [stdout] | [INFO] [stdout] 35 | index: index, [INFO] [stdout] | ^^^^^^^^^^^^ help: replace it with: `index` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#redundant_field_names [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: redundant field names in struct initialization [INFO] [stdout] --> src/segment_store.rs:153:13 [INFO] [stdout] | [INFO] [stdout] 153 | sequence_number: sequence_number, [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: replace it with: `sequence_number` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#redundant_field_names [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: redundant field names in struct initialization [INFO] [stdout] --> src/segment_store.rs:154:13 [INFO] [stdout] | [INFO] [stdout] 154 | file_path: file_path, [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^ help: replace it with: `file_path` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#redundant_field_names [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: redundant field names in struct initialization [INFO] [stdout] --> src/segment_store.rs:155:13 [INFO] [stdout] | [INFO] [stdout] 155 | index: index, [INFO] [stdout] | ^^^^^^^^^^^^ help: replace it with: `index` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#redundant_field_names [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: redundant field names in struct initialization [INFO] [stdout] --> src/segment_store.rs:212:13 [INFO] [stdout] | [INFO] [stdout] 212 | reader: reader, [INFO] [stdout] | ^^^^^^^^^^^^^^ help: replace it with: `reader` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#redundant_field_names [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: redundant field names in struct initialization [INFO] [stdout] --> src/database.rs:42:13 [INFO] [stdout] | [INFO] [stdout] 42 | segments: segments, [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^ help: replace it with: `segments` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#redundant_field_names [INFO] [stdout] = note: `#[warn(clippy::redundant_field_names)]` on by default [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: redundant field names in struct initialization [INFO] [stdout] --> src/database.rs:43:13 [INFO] [stdout] | [INFO] [stdout] 43 | directory: directory, [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^ help: replace it with: `directory` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#redundant_field_names [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: redundant field names in struct initialization [INFO] [stdout] --> src/segment_store.rs:34:9 [INFO] [stdout] | [INFO] [stdout] 34 | file_path: file_path, [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^ help: replace it with: `file_path` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#redundant_field_names [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: redundant field names in struct initialization [INFO] [stdout] --> src/segment_store.rs:35:9 [INFO] [stdout] | [INFO] [stdout] 35 | index: index, [INFO] [stdout] | ^^^^^^^^^^^^ help: replace it with: `index` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#redundant_field_names [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: redundant field names in struct initialization [INFO] [stdout] --> src/segment_store.rs:153:13 [INFO] [stdout] | [INFO] [stdout] 153 | sequence_number: sequence_number, [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: replace it with: `sequence_number` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#redundant_field_names [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: redundant field names in struct initialization [INFO] [stdout] --> src/segment_store.rs:154:13 [INFO] [stdout] | [INFO] [stdout] 154 | file_path: file_path, [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^ help: replace it with: `file_path` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#redundant_field_names [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: redundant field names in struct initialization [INFO] [stdout] --> src/segment_store.rs:155:13 [INFO] [stdout] | [INFO] [stdout] 155 | index: index, [INFO] [stdout] | ^^^^^^^^^^^^ help: replace it with: `index` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#redundant_field_names [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: redundant field names in struct initialization [INFO] [stdout] --> src/segment_store.rs:212:13 [INFO] [stdout] | [INFO] [stdout] 212 | reader: reader, [INFO] [stdout] | ^^^^^^^^^^^^^^ help: replace it with: `reader` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#redundant_field_names [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: unnecessary use of `to_owned` [INFO] [stdout] --> src/database.rs:17:28 [INFO] [stdout] | [INFO] [stdout] 17 | fs::create_dir_all(directory.to_owned())?; [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^ help: use: `&directory` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#unnecessary_to_owned [INFO] [stdout] = note: `#[warn(clippy::unnecessary_to_owned)]` on by default [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: unnecessary use of `to_owned` [INFO] [stdout] --> src/database.rs:19:34 [INFO] [stdout] | [INFO] [stdout] 19 | let paths = fs::read_dir(directory.to_owned()).unwrap(); [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^ help: use: `&directory` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#unnecessary_to_owned [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: consider using `sort_by_key` [INFO] [stdout] --> src/database.rs:29:9 [INFO] [stdout] | [INFO] [stdout] 29 | segments.sort_by(|a, b| a.get_sequence_number().cmp(&b.get_sequence_number())); [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#unnecessary_sort_by [INFO] [stdout] = note: `#[warn(clippy::unnecessary_sort_by)]` on by default [INFO] [stdout] help: try [INFO] [stdout] | [INFO] [stdout] 29 - segments.sort_by(|a, b| a.get_sequence_number().cmp(&b.get_sequence_number())); [INFO] [stdout] 29 + segments.sort_by_key(|a| a.get_sequence_number()); [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: `to_string` applied to a type that implements `Display` in `format!` args [INFO] [stdout] --> src/database.rs:31:100 [INFO] [stdout] | [INFO] [stdout] 31 | let new_segment: SegmentStore = compact(directory.join(format!("{}.seg", Uuid::new_v4().to_string())), &mut segments)?; [INFO] [stdout] | ^^^^^^^^^^^^ help: remove this [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#to_string_in_format_args [INFO] [stdout] = note: `#[warn(clippy::to_string_in_format_args)]` on by default [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this `match` expression can be replaced with `?` [INFO] [stdout] --> src/database.rs:46:23 [INFO] [stdout] | [INFO] [stdout] 46 | let entries = match db.log.iter() { [INFO] [stdout] | _______________________^ [INFO] [stdout] 47 | | Ok(entries) => entries, [INFO] [stdout] 48 | | Err(e) => return Err(e.into()) [INFO] [stdout] 49 | | }; [INFO] [stdout] | |_________^ help: try instead: `db.log.iter()?` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#question_mark [INFO] [stdout] = note: `#[warn(clippy::question_mark)]` on by default [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: you seem to be trying to use `match` for destructuring a single pattern. Consider using `if let` [INFO] [stdout] --> src/database.rs:52:13 [INFO] [stdout] | [INFO] [stdout] 52 | / match db.memory.set(&k, &v) { [INFO] [stdout] 53 | | Err(e) => return Err(e), [INFO] [stdout] 54 | | _ => {} [INFO] [stdout] 55 | | } [INFO] [stdout] | |_____________^ help: try: `if let Err(e) = db.memory.set(&k, &v) { return Err(e) }` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#single_match [INFO] [stdout] = note: `#[warn(clippy::single_match)]` on by default [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: `to_string` applied to a type that implements `Display` in `format!` args [INFO] [stdout] --> src/database.rs:68:89 [INFO] [stdout] | [INFO] [stdout] 68 | self.directory.join(self.directory.join(format!("{}.seg", Uuid::new_v4().to_string()))), [INFO] [stdout] | ^^^^^^^^^^^^ help: remove this [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#to_string_in_format_args [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: you seem to be trying to use `match` for destructuring a single pattern. Consider using `if let` [INFO] [stdout] --> src/database.rs:84:21 [INFO] [stdout] | [INFO] [stdout] 84 | / match segment.get(key) { [INFO] [stdout] 85 | | Ok(Some(value)) => return Ok(Some(value)), [INFO] [stdout] 86 | | _ => {} [INFO] [stdout] 87 | | } [INFO] [stdout] | |_____________________^ help: try: `if let Ok(Some(value)) = segment.get(key) { return Ok(Some(value)) }` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#single_match [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: unneeded `return` statement [INFO] [stdout] --> src/memory_store.rs:22:9 [INFO] [stdout] | [INFO] [stdout] 22 | return Ok(()) [INFO] [stdout] | ^^^^^^^^^^^^^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_return [INFO] [stdout] = note: `#[warn(clippy::needless_return)]` on by default [INFO] [stdout] help: remove `return` [INFO] [stdout] | [INFO] [stdout] 22 - return Ok(()) [INFO] [stdout] 22 + Ok(()) [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: unnecessary use of `.write(true)` because there is `.append(true)` [INFO] [stdout] --> src/log_store.rs:16:17 [INFO] [stdout] | [INFO] [stdout] 16 | .write(true) [INFO] [stdout] | ^^^^^^^^^^^^ help: remove `.write(true)` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#ineffective_open_options [INFO] [stdout] = note: `#[warn(clippy::ineffective_open_options)]` on by default [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: unnecessary use of `to_owned` [INFO] [stdout] --> src/log_store.rs:33:83 [INFO] [stdout] | [INFO] [stdout] 33 | self.writer = std::fs::OpenOptions::new().truncate(true).write(true).open(self.file_path.to_owned())?; [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^ help: use: `&self.file_path` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#unnecessary_to_owned [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: calling `push_str()` using a single-character string literal [INFO] [stdout] --> src/log_store.rs:47:9 [INFO] [stdout] | [INFO] [stdout] 47 | entry.push_str("\t"); [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^ help: consider using `push` with a character literal: `entry.push('\t')` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#single_char_add_str [INFO] [stdout] = note: `#[warn(clippy::single_char_add_str)]` on by default [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: calling `push_str()` using a single-character string literal [INFO] [stdout] --> src/log_store.rs:49:9 [INFO] [stdout] | [INFO] [stdout] 49 | entry.push_str("\n"); [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^ help: consider using `push` with a character literal: `entry.push('\n')` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#single_char_add_str [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this `match` expression can be replaced with `?` [INFO] [stdout] --> src/log_store.rs:64:23 [INFO] [stdout] | [INFO] [stdout] 64 | let entries = match self.iter() { [INFO] [stdout] | _______________________^ [INFO] [stdout] 65 | | Ok(entries) => entries, [INFO] [stdout] 66 | | Err(e) => return Err(e.into()) [INFO] [stdout] 67 | | }; [INFO] [stdout] | |_________^ help: try instead: `self.iter()?` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#question_mark [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: unnecessary use of `to_owned` [INFO] [stdout] --> src/segment_store.rs:17:65 [INFO] [stdout] | [INFO] [stdout] 17 | let mut reader: BufReader = BufReader::new(File::open(file_path.to_owned())?); [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^ help: use: `&file_path` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#unnecessary_to_owned [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: writing `&mut Vec` instead of `&mut [_]` involves a new object where a slice will do [INFO] [stdout] --> src/segment_store.rs:40:46 [INFO] [stdout] | [INFO] [stdout] 40 | pub fn compact(file_path: PathBuf, segments: &mut Vec) -> Result> { [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#ptr_arg [INFO] [stdout] = note: `#[warn(clippy::ptr_arg)]` on by default [INFO] [stdout] help: change this to [INFO] [stdout] | [INFO] [stdout] 40 - pub fn compact(file_path: PathBuf, segments: &mut Vec) -> Result> { [INFO] [stdout] 40 + pub fn compact(file_path: PathBuf, segments: &mut [SegmentStore]) -> Result> { [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: consider using `sort_by_key` [INFO] [stdout] --> src/segment_store.rs:41:5 [INFO] [stdout] | [INFO] [stdout] 41 | segments.sort_by(|a, b| a.get_sequence_number().cmp(&b.get_sequence_number())); [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#unnecessary_sort_by [INFO] [stdout] help: try [INFO] [stdout] | [INFO] [stdout] 41 - segments.sort_by(|a, b| a.get_sequence_number().cmp(&b.get_sequence_number())); [INFO] [stdout] 41 + segments.sort_by_key(|a| a.get_sequence_number()); [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this boolean expression can be simplified [INFO] [stdout] --> src/segment_store.rs:72:16 [INFO] [stdout] | [INFO] [stdout] 72 | if !min_iter_index.is_none() { [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^ help: try: `min_iter_index.is_some()` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#nonminimal_bool [INFO] [stdout] = note: `#[warn(clippy::nonminimal_bool)]` on by default [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: unnecessary use of `to_owned` [INFO] [stdout] --> src/database.rs:17:28 [INFO] [stdout] | [INFO] [stdout] 17 | fs::create_dir_all(directory.to_owned())?; [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^ help: use: `&directory` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#unnecessary_to_owned [INFO] [stdout] = note: `#[warn(clippy::unnecessary_to_owned)]` on by default [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: length comparison to zero [INFO] [stdout] --> src/segment_store.rs:98:12 [INFO] [stdout] | [INFO] [stdout] 98 | if self.index.len() == 0 { [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^ help: using `is_empty` is clearer and more explicit: `self.index.is_empty()` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#len_zero [INFO] [stdout] = note: `#[warn(clippy::len_zero)]` on by default [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: unnecessary use of `to_owned` [INFO] [stdout] --> src/database.rs:19:34 [INFO] [stdout] | [INFO] [stdout] 19 | let paths = fs::read_dir(directory.to_owned()).unwrap(); [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^ help: use: `&directory` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#unnecessary_to_owned [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: consider using `sort_by_key` [INFO] [stdout] --> src/database.rs:29:9 [INFO] [stdout] | [INFO] [stdout] 29 | segments.sort_by(|a, b| a.get_sequence_number().cmp(&b.get_sequence_number())); [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#unnecessary_sort_by [INFO] [stdout] = note: `#[warn(clippy::unnecessary_sort_by)]` on by default [INFO] [stdout] help: try [INFO] [stdout] | [INFO] [stdout] 29 - segments.sort_by(|a, b| a.get_sequence_number().cmp(&b.get_sequence_number())); [INFO] [stdout] 29 + segments.sort_by_key(|a| a.get_sequence_number()); [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: `to_string` applied to a type that implements `Display` in `format!` args [INFO] [stdout] --> src/database.rs:31:100 [INFO] [stdout] | [INFO] [stdout] 31 | let new_segment: SegmentStore = compact(directory.join(format!("{}.seg", Uuid::new_v4().to_string())), &mut segments)?; [INFO] [stdout] | ^^^^^^^^^^^^ help: remove this [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#to_string_in_format_args [INFO] [stdout] = note: `#[warn(clippy::to_string_in_format_args)]` on by default [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this `match` expression can be replaced with `?` [INFO] [stdout] --> src/database.rs:46:23 [INFO] [stdout] | [INFO] [stdout] 46 | let entries = match db.log.iter() { [INFO] [stdout] | _______________________^ [INFO] [stdout] 47 | | Ok(entries) => entries, [INFO] [stdout] 48 | | Err(e) => return Err(e.into()) [INFO] [stdout] 49 | | }; [INFO] [stdout] | |_________^ help: try instead: `db.log.iter()?` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#question_mark [INFO] [stdout] = note: `#[warn(clippy::question_mark)]` on by default [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: you seem to be trying to use `match` for destructuring a single pattern. Consider using `if let` [INFO] [stdout] --> src/database.rs:52:13 [INFO] [stdout] | [INFO] [stdout] 52 | / match db.memory.set(&k, &v) { [INFO] [stdout] 53 | | Err(e) => return Err(e), [INFO] [stdout] 54 | | _ => {} [INFO] [stdout] 55 | | } [INFO] [stdout] | |_____________^ help: try: `if let Err(e) = db.memory.set(&k, &v) { return Err(e) }` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#single_match [INFO] [stdout] = note: `#[warn(clippy::single_match)]` on by default [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: length comparison to zero [INFO] [stdout] --> src/segment_store.rs:144:12 [INFO] [stdout] | [INFO] [stdout] 144 | if buffer.len() > 0 { [INFO] [stdout] | ^^^^^^^^^^^^^^^^ help: using `!is_empty` is clearer and more explicit: `!buffer.is_empty()` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#len_zero [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: `to_string` applied to a type that implements `Display` in `format!` args [INFO] [stdout] --> src/database.rs:68:89 [INFO] [stdout] | [INFO] [stdout] 68 | self.directory.join(self.directory.join(format!("{}.seg", Uuid::new_v4().to_string()))), [INFO] [stdout] | ^^^^^^^^^^^^ help: remove this [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#to_string_in_format_args [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: unnecessary use of `to_owned` [INFO] [stdout] --> src/segment_store.rs:160:25 [INFO] [stdout] | [INFO] [stdout] 160 | fs::remove_file(self.file_path.to_owned()) [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^ help: use: `&self.file_path` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#unnecessary_to_owned [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: you seem to be trying to use `match` for destructuring a single pattern. Consider using `if let` [INFO] [stdout] --> src/database.rs:84:21 [INFO] [stdout] | [INFO] [stdout] 84 | / match segment.get(key) { [INFO] [stdout] 85 | | Ok(Some(value)) => return Ok(Some(value)), [INFO] [stdout] 86 | | _ => {} [INFO] [stdout] 87 | | } [INFO] [stdout] | |_____________________^ help: try: `if let Ok(Some(value)) = segment.get(key) { return Ok(Some(value)) }` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#single_match [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this assertion is always `false` [INFO] [stdout] --> src/database.rs:115:33 [INFO] [stdout] | [INFO] [stdout] 115 | ... assert!(false, "Key not found after set"); [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ [INFO] [stdout] | [INFO] [stdout] = help: replace this with `panic!()` or `unreachable!()` [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#assertions_on_constants [INFO] [stdout] = note: `#[warn(clippy::assertions_on_constants)]` on by default [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this assertion is always `false` [INFO] [stdout] --> src/database.rs:120:25 [INFO] [stdout] | [INFO] [stdout] 120 | assert!(false, "Get failed: {}", e); [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ [INFO] [stdout] | [INFO] [stdout] = help: replace this with `panic!()` or `unreachable!()` [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#assertions_on_constants [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this assertion is always `false` [INFO] [stdout] --> src/database.rs:126:17 [INFO] [stdout] | [INFO] [stdout] 126 | assert!(false, "Set failed: {}", e); [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ [INFO] [stdout] | [INFO] [stdout] = help: replace this with `panic!()` or `unreachable!()` [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#assertions_on_constants [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: unneeded `return` statement [INFO] [stdout] --> src/memory_store.rs:22:9 [INFO] [stdout] | [INFO] [stdout] 22 | return Ok(()) [INFO] [stdout] | ^^^^^^^^^^^^^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_return [INFO] [stdout] = note: `#[warn(clippy::needless_return)]` on by default [INFO] [stdout] help: remove `return` [INFO] [stdout] | [INFO] [stdout] 22 - return Ok(()) [INFO] [stdout] 22 + Ok(()) [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: unnecessary use of `to_owned` [INFO] [stdout] --> src/segment_store.rs:193:41 [INFO] [stdout] | [INFO] [stdout] 193 | let mut file: File = File::open(self.file_path.to_owned())?; [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^ help: use: `&self.file_path` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#unnecessary_to_owned [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this expression creates a reference which is immediately dereferenced by the compiler [INFO] [stdout] --> src/segment_store.rs:208:31 [INFO] [stdout] | [INFO] [stdout] 208 | let data = decompress(&block); [INFO] [stdout] | ^^^^^^ help: change this to: `block` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_borrow [INFO] [stdout] = note: `#[warn(clippy::needless_borrow)]` on by default [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: unneeded `return` statement [INFO] [stdout] --> src/segment_store.rs:287:5 [INFO] [stdout] | [INFO] [stdout] 287 | return Some(elements[mid].clone()); [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_return [INFO] [stdout] help: remove `return` [INFO] [stdout] | [INFO] [stdout] 287 - return Some(elements[mid].clone()); [INFO] [stdout] 287 + Some(elements[mid].clone()) [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: writing `&Vec` instead of `&[_]` involves a new object where a slice will do [INFO] [stdout] --> src/segment_store.rs:254:78 [INFO] [stdout] | [INFO] [stdout] 254 | fn closest_element_before (key: K, elements: &Vec<(K,V)>) -> Option<(K,V)> { [INFO] [stdout] | ^^^^^^^^^^^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#ptr_arg [INFO] [stdout] help: change this to [INFO] [stdout] | [INFO] [stdout] 254 - fn closest_element_before (key: K, elements: &Vec<(K,V)>) -> Option<(K,V)> { [INFO] [stdout] 254 + fn closest_element_before (key: K, elements: &[(K,V)]) -> Option<(K,V)> { [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: length comparison to zero [INFO] [stdout] --> src/segment_store.rs:255:8 [INFO] [stdout] | [INFO] [stdout] 255 | if elements.len() == 0 { [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^ help: using `is_empty` is clearer and more explicit: `elements.is_empty()` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#len_zero [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this assertion is always `false` [INFO] [stdout] --> src/memory_store.rs:70:33 [INFO] [stdout] | [INFO] [stdout] 70 | ... assert!(false, "Key not found after set"); [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ [INFO] [stdout] | [INFO] [stdout] = help: replace this with `panic!()` or `unreachable!()` [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#assertions_on_constants [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this assertion is always `false` [INFO] [stdout] --> src/memory_store.rs:75:25 [INFO] [stdout] | [INFO] [stdout] 75 | assert!(false, "Get failed: {}", e); [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ [INFO] [stdout] | [INFO] [stdout] = help: replace this with `panic!()` or `unreachable!()` [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#assertions_on_constants [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this assertion is always `false` [INFO] [stdout] --> src/memory_store.rs:81:17 [INFO] [stdout] | [INFO] [stdout] 81 | assert!(false, "Set failed: {}", e); [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ [INFO] [stdout] | [INFO] [stdout] = help: replace this with `panic!()` or `unreachable!()` [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#assertions_on_constants [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: unnecessary use of `.write(true)` because there is `.append(true)` [INFO] [stdout] --> src/segment_store.rs:322:9 [INFO] [stdout] | [INFO] [stdout] 322 | .write(true) [INFO] [stdout] | ^^^^^^^^^^^^ help: remove `.write(true)` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#ineffective_open_options [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: unnecessary use of `.write(true)` because there is `.append(true)` [INFO] [stdout] --> src/log_store.rs:16:17 [INFO] [stdout] | [INFO] [stdout] 16 | .write(true) [INFO] [stdout] | ^^^^^^^^^^^^ help: remove `.write(true)` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#ineffective_open_options [INFO] [stdout] = note: `#[warn(clippy::ineffective_open_options)]` on by default [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: unnecessary use of `to_owned` [INFO] [stdout] --> src/log_store.rs:33:83 [INFO] [stdout] | [INFO] [stdout] 33 | self.writer = std::fs::OpenOptions::new().truncate(true).write(true).open(self.file_path.to_owned())?; [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^ help: use: `&self.file_path` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#unnecessary_to_owned [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: calling `push_str()` using a single-character string literal [INFO] [stdout] --> src/log_store.rs:47:9 [INFO] [stdout] | [INFO] [stdout] 47 | entry.push_str("\t"); [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^ help: consider using `push` with a character literal: `entry.push('\t')` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#single_char_add_str [INFO] [stdout] = note: `#[warn(clippy::single_char_add_str)]` on by default [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: calling `push_str()` using a single-character string literal [INFO] [stdout] --> src/log_store.rs:49:9 [INFO] [stdout] | [INFO] [stdout] 49 | entry.push_str("\n"); [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^ help: consider using `push` with a character literal: `entry.push('\n')` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#single_char_add_str [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this `match` expression can be replaced with `?` [INFO] [stdout] --> src/log_store.rs:64:23 [INFO] [stdout] | [INFO] [stdout] 64 | let entries = match self.iter() { [INFO] [stdout] | _______________________^ [INFO] [stdout] 65 | | Ok(entries) => entries, [INFO] [stdout] 66 | | Err(e) => return Err(e.into()) [INFO] [stdout] 67 | | }; [INFO] [stdout] | |_________^ help: try instead: `self.iter()?` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#question_mark [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: unnecessary use of `to_owned` [INFO] [stdout] --> src/segment_store.rs:17:65 [INFO] [stdout] | [INFO] [stdout] 17 | let mut reader: BufReader = BufReader::new(File::open(file_path.to_owned())?); [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^ help: use: `&file_path` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#unnecessary_to_owned [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: writing `&mut Vec` instead of `&mut [_]` involves a new object where a slice will do [INFO] [stdout] --> src/segment_store.rs:40:46 [INFO] [stdout] | [INFO] [stdout] 40 | pub fn compact(file_path: PathBuf, segments: &mut Vec) -> Result> { [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#ptr_arg [INFO] [stdout] = note: `#[warn(clippy::ptr_arg)]` on by default [INFO] [stdout] help: change this to [INFO] [stdout] | [INFO] [stdout] 40 - pub fn compact(file_path: PathBuf, segments: &mut Vec) -> Result> { [INFO] [stdout] 40 + pub fn compact(file_path: PathBuf, segments: &mut [SegmentStore]) -> Result> { [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: consider using `sort_by_key` [INFO] [stdout] --> src/segment_store.rs:41:5 [INFO] [stdout] | [INFO] [stdout] 41 | segments.sort_by(|a, b| a.get_sequence_number().cmp(&b.get_sequence_number())); [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#unnecessary_sort_by [INFO] [stdout] help: try [INFO] [stdout] | [INFO] [stdout] 41 - segments.sort_by(|a, b| a.get_sequence_number().cmp(&b.get_sequence_number())); [INFO] [stdout] 41 + segments.sort_by_key(|a| a.get_sequence_number()); [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this boolean expression can be simplified [INFO] [stdout] --> src/segment_store.rs:72:16 [INFO] [stdout] | [INFO] [stdout] 72 | if !min_iter_index.is_none() { [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^ help: try: `min_iter_index.is_some()` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#nonminimal_bool [INFO] [stdout] = note: `#[warn(clippy::nonminimal_bool)]` on by default [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: length comparison to zero [INFO] [stdout] --> src/segment_store.rs:98:12 [INFO] [stdout] | [INFO] [stdout] 98 | if self.index.len() == 0 { [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^ help: using `is_empty` is clearer and more explicit: `self.index.is_empty()` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#len_zero [INFO] [stdout] = note: `#[warn(clippy::len_zero)]` on by default [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: length comparison to zero [INFO] [stdout] --> src/segment_store.rs:144:12 [INFO] [stdout] | [INFO] [stdout] 144 | if buffer.len() > 0 { [INFO] [stdout] | ^^^^^^^^^^^^^^^^ help: using `!is_empty` is clearer and more explicit: `!buffer.is_empty()` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#len_zero [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: unnecessary use of `to_owned` [INFO] [stdout] --> src/segment_store.rs:160:25 [INFO] [stdout] | [INFO] [stdout] 160 | fs::remove_file(self.file_path.to_owned()) [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^ help: use: `&self.file_path` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#unnecessary_to_owned [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: unnecessary use of `to_owned` [INFO] [stdout] --> src/segment_store.rs:193:41 [INFO] [stdout] | [INFO] [stdout] 193 | let mut file: File = File::open(self.file_path.to_owned())?; [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^ help: use: `&self.file_path` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#unnecessary_to_owned [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this expression creates a reference which is immediately dereferenced by the compiler [INFO] [stdout] --> src/segment_store.rs:208:31 [INFO] [stdout] | [INFO] [stdout] 208 | let data = decompress(&block); [INFO] [stdout] | ^^^^^^ help: change this to: `block` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_borrow [INFO] [stdout] = note: `#[warn(clippy::needless_borrow)]` on by default [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: unneeded `return` statement [INFO] [stdout] --> src/segment_store.rs:287:5 [INFO] [stdout] | [INFO] [stdout] 287 | return Some(elements[mid].clone()); [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_return [INFO] [stdout] help: remove `return` [INFO] [stdout] | [INFO] [stdout] 287 - return Some(elements[mid].clone()); [INFO] [stdout] 287 + Some(elements[mid].clone()) [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: writing `&Vec` instead of `&[_]` involves a new object where a slice will do [INFO] [stdout] --> src/segment_store.rs:254:78 [INFO] [stdout] | [INFO] [stdout] 254 | fn closest_element_before (key: K, elements: &Vec<(K,V)>) -> Option<(K,V)> { [INFO] [stdout] | ^^^^^^^^^^^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#ptr_arg [INFO] [stdout] help: change this to [INFO] [stdout] | [INFO] [stdout] 254 - fn closest_element_before (key: K, elements: &Vec<(K,V)>) -> Option<(K,V)> { [INFO] [stdout] 254 + fn closest_element_before (key: K, elements: &[(K,V)]) -> Option<(K,V)> { [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: length comparison to zero [INFO] [stdout] --> src/segment_store.rs:255:8 [INFO] [stdout] | [INFO] [stdout] 255 | if elements.len() == 0 { [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^ help: using `is_empty` is clearer and more explicit: `elements.is_empty()` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#len_zero [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: unnecessary use of `.write(true)` because there is `.append(true)` [INFO] [stdout] --> src/segment_store.rs:322:9 [INFO] [stdout] | [INFO] [stdout] 322 | .write(true) [INFO] [stdout] | ^^^^^^^^^^^^ help: remove `.write(true)` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#ineffective_open_options [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: called `.iter().count()` on a `BTreeMap` [INFO] [stdout] --> src/segment_store.rs:456:20 [INFO] [stdout] | [INFO] [stdout] 456 | assert_eq!(state.iter().count(), segment.iter().count()); [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^ help: try: `state.len()` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#iter_count [INFO] [stdout] = note: `#[warn(clippy::iter_count)]` on by default [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this expression creates a reference which is immediately dereferenced by the compiler [INFO] [stdout] --> src/bin/cli.rs:26:32 [INFO] [stdout] | [INFO] [stdout] 26 | let r = db.get(&chunks[1]); [INFO] [stdout] | ^^^^^^^^^^ help: change this to: `chunks[1]` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_borrow [INFO] [stdout] = note: `#[warn(clippy::needless_borrow)]` on by default [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: called `.nth(0)` on a `std::iter::Iterator`, when `.next()` is equivalent [INFO] [stdout] --> src/bin/server.rs:32:18 [INFO] [stdout] | [INFO] [stdout] 32 | let method = http_request[0].split_whitespace().nth(0).unwrap(); [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: try calling `.next()` instead of `.nth(0)`: `http_request[0].split_whitespace().next()` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#iter_nth_zero [INFO] [stdout] = note: `#[warn(clippy::iter_nth_zero)]` on by default [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: called `.nth(0)` on a `std::iter::Iterator`, when `.next()` is equivalent [INFO] [stdout] --> src/bin/server.rs:32:18 [INFO] [stdout] | [INFO] [stdout] 32 | let method = http_request[0].split_whitespace().nth(0).unwrap(); [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: try calling `.next()` instead of `.nth(0)`: `http_request[0].split_whitespace().next()` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#iter_nth_zero [INFO] [stdout] = note: `#[warn(clippy::iter_nth_zero)]` on by default [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this expression creates a reference which is immediately dereferenced by the compiler [INFO] [stdout] --> src/bin/cli.rs:26:32 [INFO] [stdout] | [INFO] [stdout] 26 | let r = db.get(&chunks[1]); [INFO] [stdout] | ^^^^^^^^^^ help: change this to: `chunks[1]` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_borrow [INFO] [stdout] = note: `#[warn(clippy::needless_borrow)]` on by default [INFO] [stdout] [INFO] [stdout] [INFO] [stderr] Finished `dev` profile [unoptimized + debuginfo] target(s) in 3.43s [INFO] running `Command { std: "docker" "inspect" "925163b0a327ecc06459abd4e376271ff7f18d8d6f2c993340c44fefe91cff8f", kill_on_drop: false }` [INFO] running `Command { std: "docker" "rm" "-f" "925163b0a327ecc06459abd4e376271ff7f18d8d6f2c993340c44fefe91cff8f", kill_on_drop: false }` [INFO] [stdout] 925163b0a327ecc06459abd4e376271ff7f18d8d6f2c993340c44fefe91cff8f