[INFO] fetching crate docufort 0.6.0... [INFO] linting docufort-0.6.0 against nightly for clippy-nonminimal_bool-denied [INFO] extracting crate docufort 0.6.0 into /workspace/builds/worker-5-tc1/source [INFO] started tweaking crates.io crate docufort 0.6.0 [INFO] removed 0 missing tests [INFO] finished tweaking crates.io crate docufort 0.6.0 [INFO] tweaked toml for crates.io crate docufort 0.6.0 written to /workspace/builds/worker-5-tc1/source/Cargo.toml [INFO] validating manifest of crates.io crate docufort 0.6.0 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 crates.io crate docufort 0.6.0 already has a lockfile, it will not be regenerated [INFO] running `Command { std: CARGO_HOME="/workspace/cargo-home" RUSTUP_HOME="/workspace/rustup-home" "/workspace/cargo-home/bin/cargo" "+nightly" "fetch" "--manifest-path" "Cargo.toml", kill_on_drop: false }` [INFO] [stderr] Updating crates.io index [INFO] [stderr] Downloading crates ... [INFO] [stderr] Downloaded reed-solomon v0.2.1 [INFO] [stderr] Downloaded zstd-safe v7.2.3 [INFO] [stderr] Downloaded either v1.14.0 [INFO] [stderr] Downloaded blake3 v1.6.1 [INFO] [stderr] Downloaded zstd-sys v2.0.14+zstd.1.5.7 [INFO] running `Command { std: "docker" "create" "-v" "/var/lib/crater-agent-workspace/builds/worker-5-tc1/target:/opt/rustwide/target:rw,Z" "-v" "/var/lib/crater-agent-workspace/builds/worker-5-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] d5fc9513cddbe2a792a8b3f46559e843218f491d5ae146a3107a389ed269fee0 [INFO] running `Command { std: "docker" "start" "-a" "d5fc9513cddbe2a792a8b3f46559e843218f491d5ae146a3107a389ed269fee0", kill_on_drop: false }` [INFO] running `Command { std: "docker" "inspect" "d5fc9513cddbe2a792a8b3f46559e843218f491d5ae146a3107a389ed269fee0", kill_on_drop: false }` [INFO] running `Command { std: "docker" "rm" "-f" "d5fc9513cddbe2a792a8b3f46559e843218f491d5ae146a3107a389ed269fee0", kill_on_drop: false }` [INFO] [stdout] d5fc9513cddbe2a792a8b3f46559e843218f491d5ae146a3107a389ed269fee0 [INFO] running `Command { std: "docker" "create" "-v" "/var/lib/crater-agent-workspace/builds/worker-5-tc1/target:/opt/rustwide/target:rw,Z" "-v" "/var/lib/crater-agent-workspace/builds/worker-5-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] 50d7909e658255eb867a4d199e23d116f15b28e8c36268d8405eb546e1798829 [INFO] running `Command { std: "docker" "start" "-a" "50d7909e658255eb867a4d199e23d116f15b28e8c36268d8405eb546e1798829", kill_on_drop: false }` [INFO] [stderr] Compiling libc v0.2.170 [INFO] [stderr] Compiling pkg-config v0.3.31 [INFO] [stderr] Compiling zstd-safe v7.2.3 [INFO] [stderr] Checking constant_time_eq v0.3.1 [INFO] [stderr] Checking reed-solomon v0.2.1 [INFO] [stderr] Compiling jobserver v0.1.32 [INFO] [stderr] Checking docufort v0.6.0 (/opt/rustwide/workdir) [INFO] [stdout] warning: can be more succinctly written as a byte str [INFO] [stdout] --> src/read.rs:37:28 [INFO] [stdout] | [INFO] [stdout] 37 | if &constants[0..2] != &[b'V',b'1'] { [INFO] [stdout] | ^^^^^^^^^^^^ help: try: `b"V1"` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#byte_char_slices [INFO] [stdout] = note: `#[warn(clippy::byte_char_slices)]` on by default [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: can be more succinctly written as a byte str [INFO] [stdout] --> src/write.rs:98:20 [INFO] [stdout] | [INFO] [stdout] 98 | file.write_all(&[b'V',b'1'])?; [INFO] [stdout] | ^^^^^^^^^^^^ help: try: `b"V1"` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#byte_char_slices [INFO] [stdout] [INFO] [stdout] [INFO] [stderr] Compiling cc v1.2.15 [INFO] [stdout] warning: needlessly taken reference of both operands [INFO] [stdout] --> src/read.rs:37:8 [INFO] [stdout] | [INFO] [stdout] 37 | if &constants[0..2] != &[b'V',b'1'] { [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#op_ref [INFO] [stdout] = note: `#[warn(clippy::op_ref)]` on by default [INFO] [stdout] help: use the values directly [INFO] [stdout] | [INFO] [stdout] 37 - if &constants[0..2] != &[b'V',b'1'] { [INFO] [stdout] 37 + if constants[0..2] != [b'V',b'1'] { [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: using `SeekFrom::Current` to start from current position [INFO] [stdout] --> src/read.rs:50:17 [INFO] [stdout] | [INFO] [stdout] 50 | let start = reader_writer.seek(std::io::SeekFrom::Current(0))?; [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: replace with: `reader_writer.stream_position()` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#seek_from_current [INFO] [stdout] = note: `#[warn(clippy::seek_from_current)]` on by default [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: needlessly taken reference of both operands [INFO] [stdout] --> src/read.rs:52:39 [INFO] [stdout] | [INFO] [stdout] 52 | let errors = if error_correct && (&buf[..MAGIC_NUMBER.len()] != &MAGIC_NUMBER || &buf[MAGIC_NUMBER.len()..] != MN_ECC) { [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#op_ref [INFO] [stdout] help: use the values directly [INFO] [stdout] | [INFO] [stdout] 52 - let errors = if error_correct && (&buf[..MAGIC_NUMBER.len()] != &MAGIC_NUMBER || &buf[MAGIC_NUMBER.len()..] != MN_ECC) { [INFO] [stdout] 52 + let errors = if error_correct && (buf[..MAGIC_NUMBER.len()] != MAGIC_NUMBER || &buf[MAGIC_NUMBER.len()..] != MN_ECC) { [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: needlessly taken reference of left operand [INFO] [stdout] --> src/read.rs:52:86 [INFO] [stdout] | [INFO] [stdout] 52 | let errors = if error_correct && (&buf[..MAGIC_NUMBER.len()] != &MAGIC_NUMBER || &buf[MAGIC_NUMBER.len()..] != MN_ECC) { [INFO] [stdout] | --------------------------^^^^^^^^^^ [INFO] [stdout] | | [INFO] [stdout] | help: use the left value directly: `buf[MAGIC_NUMBER.len()..]` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#op_ref [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: using `SeekFrom::Current` to start from current position [INFO] [stdout] --> src/read.rs:67:17 [INFO] [stdout] | [INFO] [stdout] 67 | let start = reader_writer.seek(std::io::SeekFrom::Current(0))?; [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: replace with: `reader_writer.stream_position()` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#seek_from_current [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: using `SeekFrom::Current` to start from current position [INFO] [stdout] --> src/read.rs:84:17 [INFO] [stdout] | [INFO] [stdout] 84 | let start = reader_writer.seek(std::io::SeekFrom::Current(0))?; [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: replace with: `reader_writer.stream_position()` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#seek_from_current [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: using `SeekFrom::Current` to start from current position [INFO] [stdout] --> src/read.rs:104:17 [INFO] [stdout] | [INFO] [stdout] 104 | let start = reader_writer.seek(std::io::SeekFrom::Current(0))?; [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: replace with: `reader_writer.stream_position()` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#seek_from_current [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this boolean expression can be simplified [INFO] [stdout] --> src/read.rs:127:8 [INFO] [stdout] | [INFO] [stdout] 127 | if !ecc || (ecc && !error_correct) { [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ [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] help: try [INFO] [stdout] | [INFO] [stdout] 127 - if !ecc || (ecc && !error_correct) { [INFO] [stdout] 127 + if !(ecc && error_correct) { [INFO] [stdout] | [INFO] [stdout] 127 - if !ecc || (ecc && !error_correct) { [INFO] [stdout] 127 + if !ecc || !error_correct { [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: casting to the same type is unnecessary (`usize` -> `usize`) [INFO] [stdout] --> src/read.rs:136:36 [INFO] [stdout] | [INFO] [stdout] 136 | buffer_hash(reader_writer, to_read as usize, hasher)?; [INFO] [stdout] | ^^^^^^^^^^^^^^^^ help: try: `to_read` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#unnecessary_cast [INFO] [stdout] = note: `#[warn(clippy::unnecessary_cast)]` on by default [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: useless conversion to the same type: `std::io::Error` [INFO] [stdout] --> src/read.rs:207:24 [INFO] [stdout] | [INFO] [stdout] 207 | return Err(std::io::Error::new(std::io::ErrorKind::UnexpectedEof, "Unexpected end of file").into()); [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: consider removing `.into()`: `std::io::Error::new(std::io::ErrorKind::UnexpectedEof, "Unexpected end of file")` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#useless_conversion [INFO] [stdout] = note: `#[warn(clippy::useless_conversion)]` on by default [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: using `SeekFrom::Current` to start from current position [INFO] [stdout] --> src/read.rs:231:39 [INFO] [stdout] | [INFO] [stdout] 231 | let last_good_component_end = reader_writer.seek(std::io::SeekFrom::Current(0))?; [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: replace with: `reader_writer.stream_position()` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#seek_from_current [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: using `clone` on type `Content` which implements the `Copy` trait [INFO] [stdout] --> src/read.rs:259:73 [INFO] [stdout] | [INFO] [stdout] 259 | let Content { data_len, data_start, ecc, .. } = content.clone(); [INFO] [stdout] | ^^^^^^^^^^^^^^^ help: try removing the `clone` call: `content` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#clone_on_copy [INFO] [stdout] = note: `#[warn(clippy::clone_on_copy)]` 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/write.rs:192:47 [INFO] [stdout] | [INFO] [stdout] 192 | match B::compress(content, &mut crsr, &cl) { [INFO] [stdout] | ^^^ help: change this to: `cl` [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: casting to the same type is unnecessary (`u8` -> `u8`) [INFO] [stdout] --> src/write.rs:207:50 [INFO] [stdout] | [INFO] [stdout] 207 | let header = ComponentHeader::new_from_parts(tag as u8,time_stamp , Some(data)); [INFO] [stdout] | ^^^^^^^^^ help: try: `tag` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#unnecessary_cast [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: manual implementation of `.is_multiple_of()` [INFO] [stdout] --> src/ecc.rs:12:8 [INFO] [stdout] | [INFO] [stdout] 12 | if numerator % denominator == 0 { [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: replace with: `numerator.is_multiple_of(denominator)` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#manual_is_multiple_of [INFO] [stdout] = note: `#[warn(clippy::manual_is_multiple_of)]` 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/ecc.rs:66:29 [INFO] [stdout] | [INFO] [stdout] 66 | if decoder.is_corrupted(&ecc_data) { [INFO] [stdout] | ^^^^^^^^^ help: change this to: `ecc_data` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_borrow [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this expression creates a reference which is immediately dereferenced by the compiler [INFO] [stdout] --> src/ecc.rs:67:57 [INFO] [stdout] | [INFO] [stdout] 67 | let (buffer,errors) = decoder.correct_err_count(&ecc_data,None)?; [INFO] [stdout] | ^^^^^^^^^ help: change this to: `ecc_data` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_borrow [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this expression borrows a value the compiler would automatically borrow [INFO] [stdout] --> src/ecc.rs:68:9 [INFO] [stdout] | [INFO] [stdout] 68 | (&mut ecc_data[..]).copy_from_slice(&buffer[..]); [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^ help: change this to: `ecc_data[..]` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_borrow [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: manual implementation of `.is_multiple_of()` [INFO] [stdout] --> src/ecc.rs:184:58 [INFO] [stdout] | [INFO] [stdout] 184 | let total_ecc_len = ECC_LEN * (num_complete_chunks + (total_len % C_SIZE > 0) as usize); [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^ help: replace with: `!total_len.is_multiple_of(C_SIZE)` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#manual_is_multiple_of [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: using `SeekFrom::Current` to start from current position [INFO] [stdout] --> src/recovery.rs:33:21 [INFO] [stdout] | [INFO] [stdout] 33 | let start_pos = file.seek(SeekFrom::Current(0))?; [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: replace with: `file.stream_position()` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#seek_from_current [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this can be `std::io::Error::other(_)` [INFO] [stdout] --> src/recovery.rs:38:20 [INFO] [stdout] | [INFO] [stdout] 38 | return Err(std::io::Error::new(std::io::ErrorKind::Other, "File is too small")); [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#io_other_error [INFO] [stdout] = note: `#[warn(clippy::io_other_error)]` on by default [INFO] [stdout] help: use `std::io::Error::other` [INFO] [stdout] | [INFO] [stdout] 38 - return Err(std::io::Error::new(std::io::ErrorKind::Other, "File is too small")); [INFO] [stdout] 38 + return Err(std::io::Error::other("File is too small")); [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: needlessly taken reference of both operands [INFO] [stdout] --> src/recovery.rs:48:28 [INFO] [stdout] | [INFO] [stdout] 48 | Ok(_errors) if &buff[..MN_SIZE] == &MAGIC_NUMBER => { [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#op_ref [INFO] [stdout] help: use the values directly [INFO] [stdout] | [INFO] [stdout] 48 - Ok(_errors) if &buff[..MN_SIZE] == &MAGIC_NUMBER => { [INFO] [stdout] 48 + Ok(_errors) if buff[..MN_SIZE] == MAGIC_NUMBER => { [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: casting to the same type is unnecessary (`u64` -> `u64`) [INFO] [stdout] --> src/recovery.rs:49:27 [INFO] [stdout] | [INFO] [stdout] 49 | return Ok((start_index + MN_ECC_LEN as u64) as u64) [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: try: `((start_index + MN_ECC_LEN as u64))` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#unnecessary_cast [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: unneeded `return` statement [INFO] [stdout] --> src/recovery.rs:135:27 [INFO] [stdout] | [INFO] [stdout] 135 | Err(e) => return Err(e), [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] 135 - Err(e) => return Err(e), [INFO] [stdout] 135 + Err(e) => Err(e), [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: unneeded `return` statement [INFO] [stdout] --> src/recovery.rs:142:35 [INFO] [stdout] | [INFO] [stdout] 142 | ...=> return Ok(BlockState::InvalidBlockStructure {end_of_last_good_component:block_start, info: "Found a Content Component, Expected BlockStart".to_string()}), [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] 142 - HeaderTag::CEComponent => return Ok(BlockState::InvalidBlockStructure {end_of_last_good_component:block_start, info: "Found a Content Component, Expected BlockStart".to_string()}), [INFO] [stdout] 142 + HeaderTag::CEComponent => Ok(BlockState::InvalidBlockStructure {end_of_last_good_component:block_start, info: "Found a Content Component, Expected BlockStart".to_string()}), [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: unneeded `return` statement [INFO] [stdout] --> src/recovery.rs:143:32 [INFO] [stdout] | [INFO] [stdout] 143 | ...=> return Ok(BlockState::InvalidBlockStructure {end_of_last_good_component:block_start, info: "Found a BlockEnd, expected BlockStart".to_string() }), [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] 143 - HeaderTag::EndBlock => return Ok(BlockState::InvalidBlockStructure {end_of_last_good_component:block_start, info: "Found a BlockEnd, expected BlockStart".to_string() }), [INFO] [stdout] 143 + HeaderTag::EndBlock => Ok(BlockState::InvalidBlockStructure {end_of_last_good_component:block_start, info: "Found a BlockEnd, expected BlockStart".to_string() }), [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: using `SeekFrom::Current` to start from current position [INFO] [stdout] --> src/recovery.rs:66:23 [INFO] [stdout] | [INFO] [stdout] 66 | let block_start = reader_writer.seek(std::io::SeekFrom::Current(0))?; [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: replace with: `reader_writer.stream_position()` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#seek_from_current [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: using `SeekFrom::Current` to start from current position [INFO] [stdout] --> src/recovery.rs:88:28 [INFO] [stdout] | [INFO] [stdout] 88 | let position = reader_writer.seek(std::io::SeekFrom::Current(0))?; [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: replace with: `reader_writer.stream_position()` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#seek_from_current [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: using `SeekFrom::Current` to start from current position [INFO] [stdout] --> src/recovery.rs:95:28 [INFO] [stdout] | [INFO] [stdout] 95 | let position = reader_writer.seek(std::io::SeekFrom::Current(0))?; [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: replace with: `reader_writer.stream_position()` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#seek_from_current [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: using `SeekFrom::Current` to start from current position [INFO] [stdout] --> src/recovery.rs:181:24 [INFO] [stdout] | [INFO] [stdout] 181 | let crsr_pos = file.seek(SeekFrom::Current(0)).unwrap(); [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: replace with: `file.stream_position()` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#seek_from_current [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this expression creates a reference which is immediately dereferenced by the compiler [INFO] [stdout] --> src/recovery.rs:221:48 [INFO] [stdout] | [INFO] [stdout] 221 | write_block_end(file, &header, &hash_for_end)?; [INFO] [stdout] | ^^^^^^^^^^^^^ help: change this to: `hash_for_end` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_borrow [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: using `SeekFrom::Current` to start from current position [INFO] [stdout] --> src/integrity.rs:116:23 [INFO] [stdout] | [INFO] [stdout] 116 | let cur_pos = file.seek(SeekFrom::Current(0))?; [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: replace with: `file.stream_position()` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#seek_from_current [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: using `SeekFrom::Current` to start from current position [INFO] [stdout] --> src/integrity.rs:118:30 [INFO] [stdout] | [INFO] [stdout] 118 | let after_read_pos = file.seek(SeekFrom::Current(0))?; [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: replace with: `file.stream_position()` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#seek_from_current [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: all variants have the same prefix: `Write` [INFO] [stdout] --> src/retry_writer.rs:44:1 [INFO] [stdout] | [INFO] [stdout] 44 | / enum InnerOp,B:BlockInputs> { [INFO] [stdout] 45 | | WriteMagicNumber, [INFO] [stdout] 46 | | WriteABlock{time_stamp:u64,content: T, calc_ecc: bool, compress:Option }, [INFO] [stdout] 47 | | WriteBBlockStart{time_stamp:[u8;8]}, [INFO] [stdout] ... | [INFO] [stdout] 50 | | WriteHash(Option) [INFO] [stdout] 51 | | } [INFO] [stdout] | |_^ [INFO] [stdout] | [INFO] [stdout] = help: remove the prefixes and use full paths to the variants instead of glob imports [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#enum_variant_names [INFO] [stdout] = note: `#[warn(clippy::enum_variant_names)]` on by default [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: use of `filter_map` with an identity function [INFO] [stdout] --> src/retry_writer.rs:151:27 [INFO] [stdout] | [INFO] [stdout] 151 | ].into_iter().filter_map(|x| x).collect::>(); [INFO] [stdout] | ^^^^^^^^^^^^^^^^^ help: try: `flatten()` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#filter_map_identity [INFO] [stdout] = note: `#[warn(clippy::filter_map_identity)]` on by default [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: use of `filter_map` with an identity function [INFO] [stdout] --> src/retry_writer.rs:160:27 [INFO] [stdout] | [INFO] [stdout] 160 | ].into_iter().filter_map(|x| x).collect::>(); [INFO] [stdout] | ^^^^^^^^^^^^^^^^^ help: try: `flatten()` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#filter_map_identity [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: useless conversion to the same type: `std::io::Error` [INFO] [stdout] --> src/retry_writer.rs:204:73 [INFO] [stdout] | [INFO] [stdout] 204 | Err(e) => return Err((InnerOperation{ inner, start_offset },e.into())), [INFO] [stdout] | ^^^^^^^^ help: consider removing `.into()`: `e` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#useless_conversion [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: using `SeekFrom::Current` to start from current position [INFO] [stdout] --> src/retry_writer.rs:207:15 [INFO] [stdout] | [INFO] [stdout] 207 | match file.seek(std::io::SeekFrom::Current(0)){ [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: replace with: `file.stream_position()` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#seek_from_current [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: useless conversion to the same type: `std::io::Error` [INFO] [stdout] --> src/retry_writer.rs:209:73 [INFO] [stdout] | [INFO] [stdout] 209 | Err(e) => return Err((InnerOperation{ inner, start_offset },e.into())), [INFO] [stdout] | ^^^^^^^^ help: consider removing `.into()`: `e` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#useless_conversion [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: useless conversion to the same type: `std::io::Error` [INFO] [stdout] --> src/retry_writer.rs:215:86 [INFO] [stdout] | [INFO] [stdout] 215 | return Err((InnerOperation{ inner, start_offset:Some(start_offset) },e.into())) [INFO] [stdout] | ^^^^^^^^ help: consider removing `.into()`: `e` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#useless_conversion [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this can be `std::io::Error::other(_)` [INFO] [stdout] --> src/io_retry.rs:273:25 [INFO] [stdout] | [INFO] [stdout] 273 | io::Error::new(ErrorKind::Other, fatal_err), [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#io_other_error [INFO] [stdout] help: use `std::io::Error::other` [INFO] [stdout] | [INFO] [stdout] 273 - io::Error::new(ErrorKind::Other, fatal_err), [INFO] [stdout] 273 + io::Error::other(fatal_err), [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this can be `std::io::Error::other(_)` [INFO] [stdout] --> src/io_retry.rs:275:25 [INFO] [stdout] | [INFO] [stdout] 275 | io::Error::new(ErrorKind::Other, fatal_err), [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#io_other_error [INFO] [stdout] help: use `std::io::Error::other` [INFO] [stdout] | [INFO] [stdout] 275 - io::Error::new(ErrorKind::Other, fatal_err), [INFO] [stdout] 275 + io::Error::other(fatal_err), [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this can be `std::io::Error::other(_)` [INFO] [stdout] --> src/io_retry.rs:277:25 [INFO] [stdout] | [INFO] [stdout] 277 | io::Error::new(ErrorKind::Other, fatal_err), [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#io_other_error [INFO] [stdout] help: use `std::io::Error::other` [INFO] [stdout] | [INFO] [stdout] 277 - io::Error::new(ErrorKind::Other, fatal_err), [INFO] [stdout] 277 + io::Error::other(fatal_err), [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this can be `std::io::Error::other(_)` [INFO] [stdout] --> src/io_retry.rs:279:25 [INFO] [stdout] | [INFO] [stdout] 279 | io::Error::new(ErrorKind::Other, fatal_err), [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#io_other_error [INFO] [stdout] help: use `std::io::Error::other` [INFO] [stdout] | [INFO] [stdout] 279 - io::Error::new(ErrorKind::Other, fatal_err), [INFO] [stdout] 279 + io::Error::other(fatal_err), [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this can be `std::io::Error::other(_)` [INFO] [stdout] --> src/io_retry.rs:283:25 [INFO] [stdout] | [INFO] [stdout] 283 | io::Error::new(ErrorKind::Other, fatal_err), [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#io_other_error [INFO] [stdout] help: use `std::io::Error::other` [INFO] [stdout] | [INFO] [stdout] 283 - io::Error::new(ErrorKind::Other, fatal_err), [INFO] [stdout] 283 + io::Error::other(fatal_err), [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this can be `std::io::Error::other(_)` [INFO] [stdout] --> src/io_retry.rs:286:25 [INFO] [stdout] | [INFO] [stdout] 286 | io::Error::new(ErrorKind::Other, msg), [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#io_other_error [INFO] [stdout] help: use `std::io::Error::other` [INFO] [stdout] | [INFO] [stdout] 286 - io::Error::new(ErrorKind::Other, msg), [INFO] [stdout] 286 + io::Error::other(msg), [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this can be `std::io::Error::other(_)` [INFO] [stdout] --> src/io_retry.rs:298:25 [INFO] [stdout] | [INFO] [stdout] 298 | io::Error::new(ErrorKind::Other, transient_err), [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#io_other_error [INFO] [stdout] help: use `std::io::Error::other` [INFO] [stdout] | [INFO] [stdout] 298 - io::Error::new(ErrorKind::Other, transient_err), [INFO] [stdout] 298 + io::Error::other(transient_err), [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this can be `std::io::Error::other(_)` [INFO] [stdout] --> src/io_retry.rs:300:25 [INFO] [stdout] | [INFO] [stdout] 300 | io::Error::new(ErrorKind::Other, transient_err), [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#io_other_error [INFO] [stdout] help: use `std::io::Error::other` [INFO] [stdout] | [INFO] [stdout] 300 - io::Error::new(ErrorKind::Other, transient_err), [INFO] [stdout] 300 + io::Error::other(transient_err), [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this can be `std::io::Error::other(_)` [INFO] [stdout] --> src/io_retry.rs:305:25 [INFO] [stdout] | [INFO] [stdout] 305 | io::Error::new(ErrorKind::Other, msg), [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#io_other_error [INFO] [stdout] help: use `std::io::Error::other` [INFO] [stdout] | [INFO] [stdout] 305 - io::Error::new(ErrorKind::Other, msg), [INFO] [stdout] 305 + io::Error::other(msg), [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: casting to the same type is unnecessary (`usize` -> `usize`) [INFO] [stdout] --> src/lib.rs:89:29 [INFO] [stdout] | [INFO] [stdout] 89 | pub const DATA_SIZE:usize = (255 - ECC_LEN) as usize; [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^ help: try: `(255 - ECC_LEN)` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#unnecessary_cast [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: trait `FileLike` has a `len` method but no (possibly inherited) `is_empty` method [INFO] [stdout] --> src/lib.rs:273:1 [INFO] [stdout] | [INFO] [stdout] 273 | / pub trait FileLike:std::io::Read+std::io::Write+std::io::Seek { [INFO] [stdout] 274 | | /// Truncates the underlying data to the given length. [INFO] [stdout] 275 | | fn truncate(&mut self, len: u64)->std::io::Result<()>; [INFO] [stdout] 276 | | /// Returns the length of the underlying data. [INFO] [stdout] 277 | | fn len(&self)->std::io::Result; [INFO] [stdout] 278 | | } [INFO] [stdout] | |_^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#len_without_is_empty [INFO] [stdout] = note: `#[warn(clippy::len_without_is_empty)]` on by default [INFO] [stdout] [INFO] [stdout] [INFO] [stderr] Compiling zstd-sys v2.0.14+zstd.1.5.7 [INFO] [stderr] Compiling blake3 v1.6.1 [INFO] [stderr] Checking zstd v0.13.3 [INFO] [stdout] warning: can be more succinctly written as a byte str [INFO] [stdout] --> src/read.rs:37:28 [INFO] [stdout] | [INFO] [stdout] 37 | if &constants[0..2] != &[b'V',b'1'] { [INFO] [stdout] | ^^^^^^^^^^^^ help: try: `b"V1"` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#byte_char_slices [INFO] [stdout] = note: `#[warn(clippy::byte_char_slices)]` on by default [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: can be more succinctly written as a byte str [INFO] [stdout] --> src/write.rs:98:20 [INFO] [stdout] | [INFO] [stdout] 98 | file.write_all(&[b'V',b'1'])?; [INFO] [stdout] | ^^^^^^^^^^^^ help: try: `b"V1"` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#byte_char_slices [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: used `assert_eq!` with a literal bool [INFO] [stdout] --> tests/integrity.rs:134:5 [INFO] [stdout] | [INFO] [stdout] 134 | assert_eq!(last_block_state.unwrap().is_open_b(), true); [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#bool_assert_comparison [INFO] [stdout] = note: `#[warn(clippy::bool_assert_comparison)]` on by default [INFO] [stdout] help: replace it with `assert!(..)` [INFO] [stdout] | [INFO] [stdout] 134 - assert_eq!(last_block_state.unwrap().is_open_b(), true); [INFO] [stdout] 134 + assert!(last_block_state.unwrap().is_open_b()); [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: used `assert_eq!` with a literal bool [INFO] [stdout] --> tests/integrity.rs:159:5 [INFO] [stdout] | [INFO] [stdout] 159 | assert_eq!(last_block_state.unwrap().is_closed(), true); [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#bool_assert_comparison [INFO] [stdout] help: replace it with `assert!(..)` [INFO] [stdout] | [INFO] [stdout] 159 - assert_eq!(last_block_state.unwrap().is_closed(), true); [INFO] [stdout] 159 + assert!(last_block_state.unwrap().is_closed()); [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: used `assert_eq!` with a literal bool [INFO] [stdout] --> tests/integrity.rs:184:5 [INFO] [stdout] | [INFO] [stdout] 184 | assert_eq!(last_block_state.unwrap().is_closed(), true); [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#bool_assert_comparison [INFO] [stdout] help: replace it with `assert!(..)` [INFO] [stdout] | [INFO] [stdout] 184 - assert_eq!(last_block_state.unwrap().is_closed(), true); [INFO] [stdout] 184 + assert!(last_block_state.unwrap().is_closed()); [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: used `assert_eq!` with a literal bool [INFO] [stdout] --> tests/integrity.rs:212:5 [INFO] [stdout] | [INFO] [stdout] 212 | assert_eq!(last_block_state.unwrap().is_open_a(), true); [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#bool_assert_comparison [INFO] [stdout] help: replace it with `assert!(..)` [INFO] [stdout] | [INFO] [stdout] 212 - assert_eq!(last_block_state.unwrap().is_open_a(), true); [INFO] [stdout] 212 + assert!(last_block_state.unwrap().is_open_a()); [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: used `assert_eq!` with a literal bool [INFO] [stdout] --> tests/integrity.rs:242:5 [INFO] [stdout] | [INFO] [stdout] 242 | assert_eq!(last_block_state.unwrap().is_open_a(), true); [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#bool_assert_comparison [INFO] [stdout] help: replace it with `assert!(..)` [INFO] [stdout] | [INFO] [stdout] 242 - assert_eq!(last_block_state.unwrap().is_open_a(), true); [INFO] [stdout] 242 + assert!(last_block_state.unwrap().is_open_a()); [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: needlessly taken reference of both operands [INFO] [stdout] --> src/read.rs:37:8 [INFO] [stdout] | [INFO] [stdout] 37 | if &constants[0..2] != &[b'V',b'1'] { [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#op_ref [INFO] [stdout] = note: `#[warn(clippy::op_ref)]` on by default [INFO] [stdout] help: use the values directly [INFO] [stdout] | [INFO] [stdout] 37 - if &constants[0..2] != &[b'V',b'1'] { [INFO] [stdout] 37 + if constants[0..2] != [b'V',b'1'] { [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: using `SeekFrom::Current` to start from current position [INFO] [stdout] --> src/read.rs:50:17 [INFO] [stdout] | [INFO] [stdout] 50 | let start = reader_writer.seek(std::io::SeekFrom::Current(0))?; [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: replace with: `reader_writer.stream_position()` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#seek_from_current [INFO] [stdout] = note: `#[warn(clippy::seek_from_current)]` on by default [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: needlessly taken reference of both operands [INFO] [stdout] --> src/read.rs:52:39 [INFO] [stdout] | [INFO] [stdout] 52 | let errors = if error_correct && (&buf[..MAGIC_NUMBER.len()] != &MAGIC_NUMBER || &buf[MAGIC_NUMBER.len()..] != MN_ECC) { [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#op_ref [INFO] [stdout] help: use the values directly [INFO] [stdout] | [INFO] [stdout] 52 - let errors = if error_correct && (&buf[..MAGIC_NUMBER.len()] != &MAGIC_NUMBER || &buf[MAGIC_NUMBER.len()..] != MN_ECC) { [INFO] [stdout] 52 + let errors = if error_correct && (buf[..MAGIC_NUMBER.len()] != MAGIC_NUMBER || &buf[MAGIC_NUMBER.len()..] != MN_ECC) { [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: needlessly taken reference of left operand [INFO] [stdout] --> src/read.rs:52:86 [INFO] [stdout] | [INFO] [stdout] 52 | let errors = if error_correct && (&buf[..MAGIC_NUMBER.len()] != &MAGIC_NUMBER || &buf[MAGIC_NUMBER.len()..] != MN_ECC) { [INFO] [stdout] | --------------------------^^^^^^^^^^ [INFO] [stdout] | | [INFO] [stdout] | help: use the left value directly: `buf[MAGIC_NUMBER.len()..]` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#op_ref [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: using `SeekFrom::Current` to start from current position [INFO] [stdout] --> src/read.rs:67:17 [INFO] [stdout] | [INFO] [stdout] 67 | let start = reader_writer.seek(std::io::SeekFrom::Current(0))?; [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: replace with: `reader_writer.stream_position()` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#seek_from_current [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: using `SeekFrom::Current` to start from current position [INFO] [stdout] --> src/read.rs:84:17 [INFO] [stdout] | [INFO] [stdout] 84 | let start = reader_writer.seek(std::io::SeekFrom::Current(0))?; [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: replace with: `reader_writer.stream_position()` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#seek_from_current [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: using `SeekFrom::Current` to start from current position [INFO] [stdout] --> src/read.rs:104:17 [INFO] [stdout] | [INFO] [stdout] 104 | let start = reader_writer.seek(std::io::SeekFrom::Current(0))?; [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: replace with: `reader_writer.stream_position()` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#seek_from_current [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this boolean expression can be simplified [INFO] [stdout] --> src/read.rs:127:8 [INFO] [stdout] | [INFO] [stdout] 127 | if !ecc || (ecc && !error_correct) { [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ [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] help: try [INFO] [stdout] | [INFO] [stdout] 127 - if !ecc || (ecc && !error_correct) { [INFO] [stdout] 127 + if !(ecc && error_correct) { [INFO] [stdout] | [INFO] [stdout] 127 - if !ecc || (ecc && !error_correct) { [INFO] [stdout] 127 + if !ecc || !error_correct { [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: casting to the same type is unnecessary (`usize` -> `usize`) [INFO] [stdout] --> src/read.rs:136:36 [INFO] [stdout] | [INFO] [stdout] 136 | buffer_hash(reader_writer, to_read as usize, hasher)?; [INFO] [stdout] | ^^^^^^^^^^^^^^^^ help: try: `to_read` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#unnecessary_cast [INFO] [stdout] = note: `#[warn(clippy::unnecessary_cast)]` on by default [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: useless conversion to the same type: `std::io::Error` [INFO] [stdout] --> src/read.rs:207:24 [INFO] [stdout] | [INFO] [stdout] 207 | return Err(std::io::Error::new(std::io::ErrorKind::UnexpectedEof, "Unexpected end of file").into()); [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: consider removing `.into()`: `std::io::Error::new(std::io::ErrorKind::UnexpectedEof, "Unexpected end of file")` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#useless_conversion [INFO] [stdout] = note: `#[warn(clippy::useless_conversion)]` on by default [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: using `SeekFrom::Current` to start from current position [INFO] [stdout] --> src/read.rs:231:39 [INFO] [stdout] | [INFO] [stdout] 231 | let last_good_component_end = reader_writer.seek(std::io::SeekFrom::Current(0))?; [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: replace with: `reader_writer.stream_position()` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#seek_from_current [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: using `clone` on type `Content` which implements the `Copy` trait [INFO] [stdout] --> src/read.rs:259:73 [INFO] [stdout] | [INFO] [stdout] 259 | let Content { data_len, data_start, ecc, .. } = content.clone(); [INFO] [stdout] | ^^^^^^^^^^^^^^^ help: try removing the `clone` call: `content` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#clone_on_copy [INFO] [stdout] = note: `#[warn(clippy::clone_on_copy)]` 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/write.rs:192:47 [INFO] [stdout] | [INFO] [stdout] 192 | match B::compress(content, &mut crsr, &cl) { [INFO] [stdout] | ^^^ help: change this to: `cl` [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: casting to the same type is unnecessary (`u8` -> `u8`) [INFO] [stdout] --> src/write.rs:207:50 [INFO] [stdout] | [INFO] [stdout] 207 | let header = ComponentHeader::new_from_parts(tag as u8,time_stamp , Some(data)); [INFO] [stdout] | ^^^^^^^^^ help: try: `tag` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#unnecessary_cast [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: manual implementation of `.is_multiple_of()` [INFO] [stdout] --> src/ecc.rs:12:8 [INFO] [stdout] | [INFO] [stdout] 12 | if numerator % denominator == 0 { [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: replace with: `numerator.is_multiple_of(denominator)` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#manual_is_multiple_of [INFO] [stdout] = note: `#[warn(clippy::manual_is_multiple_of)]` 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/ecc.rs:66:29 [INFO] [stdout] | [INFO] [stdout] 66 | if decoder.is_corrupted(&ecc_data) { [INFO] [stdout] | ^^^^^^^^^ help: change this to: `ecc_data` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_borrow [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this expression creates a reference which is immediately dereferenced by the compiler [INFO] [stdout] --> src/ecc.rs:67:57 [INFO] [stdout] | [INFO] [stdout] 67 | let (buffer,errors) = decoder.correct_err_count(&ecc_data,None)?; [INFO] [stdout] | ^^^^^^^^^ help: change this to: `ecc_data` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_borrow [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this expression borrows a value the compiler would automatically borrow [INFO] [stdout] --> src/ecc.rs:68:9 [INFO] [stdout] | [INFO] [stdout] 68 | (&mut ecc_data[..]).copy_from_slice(&buffer[..]); [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^ help: change this to: `ecc_data[..]` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_borrow [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: manual implementation of `.is_multiple_of()` [INFO] [stdout] --> src/ecc.rs:184:58 [INFO] [stdout] | [INFO] [stdout] 184 | let total_ecc_len = ECC_LEN * (num_complete_chunks + (total_len % C_SIZE > 0) as usize); [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^ help: replace with: `!total_len.is_multiple_of(C_SIZE)` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#manual_is_multiple_of [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: using `SeekFrom::Current` to start from current position [INFO] [stdout] --> src/recovery.rs:33:21 [INFO] [stdout] | [INFO] [stdout] 33 | let start_pos = file.seek(SeekFrom::Current(0))?; [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: replace with: `file.stream_position()` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#seek_from_current [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this can be `std::io::Error::other(_)` [INFO] [stdout] --> src/recovery.rs:38:20 [INFO] [stdout] | [INFO] [stdout] 38 | return Err(std::io::Error::new(std::io::ErrorKind::Other, "File is too small")); [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#io_other_error [INFO] [stdout] = note: `#[warn(clippy::io_other_error)]` on by default [INFO] [stdout] help: use `std::io::Error::other` [INFO] [stdout] | [INFO] [stdout] 38 - return Err(std::io::Error::new(std::io::ErrorKind::Other, "File is too small")); [INFO] [stdout] 38 + return Err(std::io::Error::other("File is too small")); [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: needlessly taken reference of both operands [INFO] [stdout] --> src/recovery.rs:48:28 [INFO] [stdout] | [INFO] [stdout] 48 | Ok(_errors) if &buff[..MN_SIZE] == &MAGIC_NUMBER => { [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#op_ref [INFO] [stdout] help: use the values directly [INFO] [stdout] | [INFO] [stdout] 48 - Ok(_errors) if &buff[..MN_SIZE] == &MAGIC_NUMBER => { [INFO] [stdout] 48 + Ok(_errors) if buff[..MN_SIZE] == MAGIC_NUMBER => { [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: casting to the same type is unnecessary (`u64` -> `u64`) [INFO] [stdout] --> src/recovery.rs:49:27 [INFO] [stdout] | [INFO] [stdout] 49 | return Ok((start_index + MN_ECC_LEN as u64) as u64) [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: try: `((start_index + MN_ECC_LEN as u64))` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#unnecessary_cast [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: unneeded `return` statement [INFO] [stdout] --> src/recovery.rs:135:27 [INFO] [stdout] | [INFO] [stdout] 135 | Err(e) => return Err(e), [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] 135 - Err(e) => return Err(e), [INFO] [stdout] 135 + Err(e) => Err(e), [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: unneeded `return` statement [INFO] [stdout] --> src/recovery.rs:142:35 [INFO] [stdout] | [INFO] [stdout] 142 | ...=> return Ok(BlockState::InvalidBlockStructure {end_of_last_good_component:block_start, info: "Found a Content Component, Expected BlockStart".to_string()}), [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] 142 - HeaderTag::CEComponent => return Ok(BlockState::InvalidBlockStructure {end_of_last_good_component:block_start, info: "Found a Content Component, Expected BlockStart".to_string()}), [INFO] [stdout] 142 + HeaderTag::CEComponent => Ok(BlockState::InvalidBlockStructure {end_of_last_good_component:block_start, info: "Found a Content Component, Expected BlockStart".to_string()}), [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: unneeded `return` statement [INFO] [stdout] --> src/recovery.rs:143:32 [INFO] [stdout] | [INFO] [stdout] 143 | ...=> return Ok(BlockState::InvalidBlockStructure {end_of_last_good_component:block_start, info: "Found a BlockEnd, expected BlockStart".to_string() }), [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] 143 - HeaderTag::EndBlock => return Ok(BlockState::InvalidBlockStructure {end_of_last_good_component:block_start, info: "Found a BlockEnd, expected BlockStart".to_string() }), [INFO] [stdout] 143 + HeaderTag::EndBlock => Ok(BlockState::InvalidBlockStructure {end_of_last_good_component:block_start, info: "Found a BlockEnd, expected BlockStart".to_string() }), [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: using `SeekFrom::Current` to start from current position [INFO] [stdout] --> src/recovery.rs:66:23 [INFO] [stdout] | [INFO] [stdout] 66 | let block_start = reader_writer.seek(std::io::SeekFrom::Current(0))?; [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: replace with: `reader_writer.stream_position()` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#seek_from_current [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: using `SeekFrom::Current` to start from current position [INFO] [stdout] --> src/recovery.rs:88:28 [INFO] [stdout] | [INFO] [stdout] 88 | let position = reader_writer.seek(std::io::SeekFrom::Current(0))?; [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: replace with: `reader_writer.stream_position()` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#seek_from_current [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: using `SeekFrom::Current` to start from current position [INFO] [stdout] --> src/recovery.rs:95:28 [INFO] [stdout] | [INFO] [stdout] 95 | let position = reader_writer.seek(std::io::SeekFrom::Current(0))?; [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: replace with: `reader_writer.stream_position()` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#seek_from_current [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: using `SeekFrom::Current` to start from current position [INFO] [stdout] --> src/recovery.rs:181:24 [INFO] [stdout] | [INFO] [stdout] 181 | let crsr_pos = file.seek(SeekFrom::Current(0)).unwrap(); [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: replace with: `file.stream_position()` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#seek_from_current [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this expression creates a reference which is immediately dereferenced by the compiler [INFO] [stdout] --> src/recovery.rs:221:48 [INFO] [stdout] | [INFO] [stdout] 221 | write_block_end(file, &header, &hash_for_end)?; [INFO] [stdout] | ^^^^^^^^^^^^^ help: change this to: `hash_for_end` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_borrow [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: using `SeekFrom::Current` to start from current position [INFO] [stdout] --> src/integrity.rs:116:23 [INFO] [stdout] | [INFO] [stdout] 116 | let cur_pos = file.seek(SeekFrom::Current(0))?; [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: replace with: `file.stream_position()` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#seek_from_current [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: using `SeekFrom::Current` to start from current position [INFO] [stdout] --> src/integrity.rs:118:30 [INFO] [stdout] | [INFO] [stdout] 118 | let after_read_pos = file.seek(SeekFrom::Current(0))?; [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: replace with: `file.stream_position()` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#seek_from_current [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: all variants have the same prefix: `Write` [INFO] [stdout] --> src/retry_writer.rs:44:1 [INFO] [stdout] | [INFO] [stdout] 44 | / enum InnerOp,B:BlockInputs> { [INFO] [stdout] 45 | | WriteMagicNumber, [INFO] [stdout] 46 | | WriteABlock{time_stamp:u64,content: T, calc_ecc: bool, compress:Option }, [INFO] [stdout] 47 | | WriteBBlockStart{time_stamp:[u8;8]}, [INFO] [stdout] ... | [INFO] [stdout] 50 | | WriteHash(Option) [INFO] [stdout] 51 | | } [INFO] [stdout] | |_^ [INFO] [stdout] | [INFO] [stdout] = help: remove the prefixes and use full paths to the variants instead of glob imports [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#enum_variant_names [INFO] [stdout] = note: `#[warn(clippy::enum_variant_names)]` on by default [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: use of `filter_map` with an identity function [INFO] [stdout] --> src/retry_writer.rs:151:27 [INFO] [stdout] | [INFO] [stdout] 151 | ].into_iter().filter_map(|x| x).collect::>(); [INFO] [stdout] | ^^^^^^^^^^^^^^^^^ help: try: `flatten()` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#filter_map_identity [INFO] [stdout] = note: `#[warn(clippy::filter_map_identity)]` on by default [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: use of `filter_map` with an identity function [INFO] [stdout] --> src/retry_writer.rs:160:27 [INFO] [stdout] | [INFO] [stdout] 160 | ].into_iter().filter_map(|x| x).collect::>(); [INFO] [stdout] | ^^^^^^^^^^^^^^^^^ help: try: `flatten()` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#filter_map_identity [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: useless conversion to the same type: `std::io::Error` [INFO] [stdout] --> src/retry_writer.rs:204:73 [INFO] [stdout] | [INFO] [stdout] 204 | Err(e) => return Err((InnerOperation{ inner, start_offset },e.into())), [INFO] [stdout] | ^^^^^^^^ help: consider removing `.into()`: `e` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#useless_conversion [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: using `SeekFrom::Current` to start from current position [INFO] [stdout] --> src/retry_writer.rs:207:15 [INFO] [stdout] | [INFO] [stdout] 207 | match file.seek(std::io::SeekFrom::Current(0)){ [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: replace with: `file.stream_position()` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#seek_from_current [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: useless conversion to the same type: `std::io::Error` [INFO] [stdout] --> src/retry_writer.rs:209:73 [INFO] [stdout] | [INFO] [stdout] 209 | Err(e) => return Err((InnerOperation{ inner, start_offset },e.into())), [INFO] [stdout] | ^^^^^^^^ help: consider removing `.into()`: `e` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#useless_conversion [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: useless conversion to the same type: `std::io::Error` [INFO] [stdout] --> src/retry_writer.rs:215:86 [INFO] [stdout] | [INFO] [stdout] 215 | return Err((InnerOperation{ inner, start_offset:Some(start_offset) },e.into())) [INFO] [stdout] | ^^^^^^^^ help: consider removing `.into()`: `e` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#useless_conversion [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this can be `std::io::Error::other(_)` [INFO] [stdout] --> src/io_retry.rs:273:25 [INFO] [stdout] | [INFO] [stdout] 273 | io::Error::new(ErrorKind::Other, fatal_err), [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#io_other_error [INFO] [stdout] help: use `std::io::Error::other` [INFO] [stdout] | [INFO] [stdout] 273 - io::Error::new(ErrorKind::Other, fatal_err), [INFO] [stdout] 273 + io::Error::other(fatal_err), [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this can be `std::io::Error::other(_)` [INFO] [stdout] --> src/io_retry.rs:275:25 [INFO] [stdout] | [INFO] [stdout] 275 | io::Error::new(ErrorKind::Other, fatal_err), [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#io_other_error [INFO] [stdout] help: use `std::io::Error::other` [INFO] [stdout] | [INFO] [stdout] 275 - io::Error::new(ErrorKind::Other, fatal_err), [INFO] [stdout] 275 + io::Error::other(fatal_err), [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this can be `std::io::Error::other(_)` [INFO] [stdout] --> src/io_retry.rs:277:25 [INFO] [stdout] | [INFO] [stdout] 277 | io::Error::new(ErrorKind::Other, fatal_err), [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#io_other_error [INFO] [stdout] help: use `std::io::Error::other` [INFO] [stdout] | [INFO] [stdout] 277 - io::Error::new(ErrorKind::Other, fatal_err), [INFO] [stdout] 277 + io::Error::other(fatal_err), [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this can be `std::io::Error::other(_)` [INFO] [stdout] --> src/io_retry.rs:279:25 [INFO] [stdout] | [INFO] [stdout] 279 | io::Error::new(ErrorKind::Other, fatal_err), [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#io_other_error [INFO] [stdout] help: use `std::io::Error::other` [INFO] [stdout] | [INFO] [stdout] 279 - io::Error::new(ErrorKind::Other, fatal_err), [INFO] [stdout] 279 + io::Error::other(fatal_err), [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this can be `std::io::Error::other(_)` [INFO] [stdout] --> src/io_retry.rs:283:25 [INFO] [stdout] | [INFO] [stdout] 283 | io::Error::new(ErrorKind::Other, fatal_err), [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#io_other_error [INFO] [stdout] help: use `std::io::Error::other` [INFO] [stdout] | [INFO] [stdout] 283 - io::Error::new(ErrorKind::Other, fatal_err), [INFO] [stdout] 283 + io::Error::other(fatal_err), [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this can be `std::io::Error::other(_)` [INFO] [stdout] --> src/io_retry.rs:286:25 [INFO] [stdout] | [INFO] [stdout] 286 | io::Error::new(ErrorKind::Other, msg), [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#io_other_error [INFO] [stdout] help: use `std::io::Error::other` [INFO] [stdout] | [INFO] [stdout] 286 - io::Error::new(ErrorKind::Other, msg), [INFO] [stdout] 286 + io::Error::other(msg), [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this can be `std::io::Error::other(_)` [INFO] [stdout] --> src/io_retry.rs:298:25 [INFO] [stdout] | [INFO] [stdout] 298 | io::Error::new(ErrorKind::Other, transient_err), [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#io_other_error [INFO] [stdout] help: use `std::io::Error::other` [INFO] [stdout] | [INFO] [stdout] 298 - io::Error::new(ErrorKind::Other, transient_err), [INFO] [stdout] 298 + io::Error::other(transient_err), [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this can be `std::io::Error::other(_)` [INFO] [stdout] --> src/io_retry.rs:300:25 [INFO] [stdout] | [INFO] [stdout] 300 | io::Error::new(ErrorKind::Other, transient_err), [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#io_other_error [INFO] [stdout] help: use `std::io::Error::other` [INFO] [stdout] | [INFO] [stdout] 300 - io::Error::new(ErrorKind::Other, transient_err), [INFO] [stdout] 300 + io::Error::other(transient_err), [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this can be `std::io::Error::other(_)` [INFO] [stdout] --> src/io_retry.rs:305:25 [INFO] [stdout] | [INFO] [stdout] 305 | io::Error::new(ErrorKind::Other, msg), [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#io_other_error [INFO] [stdout] help: use `std::io::Error::other` [INFO] [stdout] | [INFO] [stdout] 305 - io::Error::new(ErrorKind::Other, msg), [INFO] [stdout] 305 + io::Error::other(msg), [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: casting to the same type is unnecessary (`usize` -> `usize`) [INFO] [stdout] --> src/lib.rs:89:29 [INFO] [stdout] | [INFO] [stdout] 89 | pub const DATA_SIZE:usize = (255 - ECC_LEN) as usize; [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^ help: try: `(255 - ECC_LEN)` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#unnecessary_cast [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: trait `FileLike` has a `len` method but no (possibly inherited) `is_empty` method [INFO] [stdout] --> src/lib.rs:273:1 [INFO] [stdout] | [INFO] [stdout] 273 | / pub trait FileLike:std::io::Read+std::io::Write+std::io::Seek { [INFO] [stdout] 274 | | /// Truncates the underlying data to the given length. [INFO] [stdout] 275 | | fn truncate(&mut self, len: u64)->std::io::Result<()>; [INFO] [stdout] 276 | | /// Returns the length of the underlying data. [INFO] [stdout] 277 | | fn len(&self)->std::io::Result; [INFO] [stdout] 278 | | } [INFO] [stdout] | |_^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#len_without_is_empty [INFO] [stdout] = note: `#[warn(clippy::len_without_is_empty)]` on by default [INFO] [stdout] [INFO] [stdout] [INFO] [stderr] Finished `dev` profile [unoptimized + debuginfo] target(s) in 12.21s [INFO] running `Command { std: "docker" "inspect" "50d7909e658255eb867a4d199e23d116f15b28e8c36268d8405eb546e1798829", kill_on_drop: false }` [INFO] running `Command { std: "docker" "rm" "-f" "50d7909e658255eb867a4d199e23d116f15b28e8c36268d8405eb546e1798829", kill_on_drop: false }` [INFO] [stdout] 50d7909e658255eb867a4d199e23d116f15b28e8c36268d8405eb546e1798829