[INFO] fetching crate rawler 0.7.2... [INFO] linting rawler-0.7.2 against nightly for clippy-nonminimal_bool-denied [INFO] extracting crate rawler 0.7.2 into /workspace/builds/worker-7-tc1/source [INFO] started tweaking crates.io crate rawler 0.7.2 [INFO] removed 0 missing tests [INFO] finished tweaking crates.io crate rawler 0.7.2 [INFO] tweaked toml for crates.io crate rawler 0.7.2 written to /workspace/builds/worker-7-tc1/source/Cargo.toml [INFO] validating manifest of crates.io crate rawler 0.7.2 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 rawler 0.7.2 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 libflate v2.1.0 [INFO] [stderr] Downloaded libflate_lz77 v2.1.0 [INFO] [stderr] Downloaded bitstream-io v4.5.0 [INFO] [stderr] Downloaded jxl-color v0.11.0 [INFO] [stderr] Downloaded jxl-jbr v0.2.0 [INFO] [stderr] Downloaded jxl-frame v0.13.1 [INFO] [stderr] Downloaded jxl-coding v1.0.0 [INFO] [stderr] Downloaded jxl-oxide v0.12.2 [INFO] [stderr] Downloaded jxl-render v0.12.1 [INFO] [stderr] Downloaded zune-jpeg v0.4.19 [INFO] [stderr] Downloaded multiversion-macros v0.8.0 [INFO] [stderr] Downloaded jxl-image v0.13.0 [INFO] [stderr] Downloaded jxl-oxide-common v1.0.0 [INFO] [stderr] Downloaded jxl-threadpool v1.0.0 [INFO] [stderr] Downloaded target-features v0.1.6 [INFO] [stderr] Downloaded multiversion v0.8.0 [INFO] [stderr] Downloaded jxl-grid v0.6.0 [INFO] [stderr] Downloaded jxl-modular v0.11.0 [INFO] [stderr] Downloaded jxl-bitstream v1.0.0 [INFO] [stderr] Downloaded jxl-vardct v0.11.0 [INFO] [stderr] Downloaded dary_heap v0.3.7 [INFO] running `Command { std: "docker" "create" "-v" "/var/lib/crater-agent-workspace/builds/worker-7-tc1/target:/opt/rustwide/target:rw,Z" "-v" "/var/lib/crater-agent-workspace/builds/worker-7-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] f6c135319367204e6cd7e583f738e8b1dc117696355243f928666a8727e01f5f [INFO] running `Command { std: "docker" "start" "-a" "f6c135319367204e6cd7e583f738e8b1dc117696355243f928666a8727e01f5f", kill_on_drop: false }` [INFO] running `Command { std: "docker" "inspect" "f6c135319367204e6cd7e583f738e8b1dc117696355243f928666a8727e01f5f", kill_on_drop: false }` [INFO] running `Command { std: "docker" "rm" "-f" "f6c135319367204e6cd7e583f738e8b1dc117696355243f928666a8727e01f5f", kill_on_drop: false }` [INFO] [stdout] f6c135319367204e6cd7e583f738e8b1dc117696355243f928666a8727e01f5f [INFO] running `Command { std: "docker" "create" "-v" "/var/lib/crater-agent-workspace/builds/worker-7-tc1/target:/opt/rustwide/target:rw,Z" "-v" "/var/lib/crater-agent-workspace/builds/worker-7-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] a96da0c6568f4d28a83103723a6de3075d64a56b1284cd77ab66e7855d4fa5d1 [INFO] running `Command { std: "docker" "start" "-a" "a96da0c6568f4d28a83103723a6de3075d64a56b1284cd77ab66e7855d4fa5d1", kill_on_drop: false }` [INFO] [stderr] Compiling rayon-core v1.12.1 [INFO] [stderr] Compiling serde v1.0.219 [INFO] [stderr] Compiling hashbrown v0.15.4 [INFO] [stderr] Compiling toml_write v0.1.2 [INFO] [stderr] Compiling winnow v0.7.12 [INFO] [stderr] Compiling target-features v0.1.6 [INFO] [stderr] Checking core2 v0.4.0 [INFO] [stderr] Compiling syn v2.0.104 [INFO] [stderr] Checking jxl-bitstream v1.0.0 [INFO] [stderr] Checking jxl-grid v0.6.0 [INFO] [stderr] Checking bytemuck v1.23.1 [INFO] [stderr] Compiling crc32fast v1.5.0 [INFO] [stderr] Checking num-bigint v0.4.6 [INFO] [stderr] Checking brotli-decompressor v5.0.0 [INFO] [stderr] Checking aho-corasick v1.1.3 [INFO] [stderr] Compiling glob v0.3.2 [INFO] [stderr] Checking zune-core v0.4.12 [INFO] [stderr] Checking rle-decode-fast v1.0.3 [INFO] [stderr] Checking zune-jpeg v0.4.19 [INFO] [stderr] Checking getrandom v0.3.3 [INFO] [stderr] Checking object v0.36.7 [INFO] [stderr] Checking num-iter v0.1.45 [INFO] [stderr] Checking num-complex v0.4.6 [INFO] [stderr] Checking adler32 v1.2.0 [INFO] [stderr] Checking rustc-demangle v0.1.25 [INFO] [stderr] Checking jxl-oxide-common v1.0.0 [INFO] [stderr] Checking jxl-coding v1.0.0 [INFO] [stderr] Checking dary_heap v0.3.7 [INFO] [stderr] Checking jxl-image v0.13.0 [INFO] [stderr] Checking chrono v0.4.41 [INFO] [stderr] Checking rayon v1.10.0 [INFO] [stderr] Checking bitstream-io v4.5.0 [INFO] [stderr] Checking memmap2 v0.9.7 [INFO] [stderr] Compiling indexmap v2.10.0 [INFO] [stderr] Checking half v2.6.0 [INFO] [stderr] Checking weezl v0.1.10 [INFO] [stderr] Checking md5 v0.8.0 [INFO] [stderr] Checking ciborium-ll v0.2.2 [INFO] [stderr] Checking clap_builder v4.5.41 [INFO] [stderr] Checking anstream v0.6.19 [INFO] [stderr] Checking criterion-plot v0.6.0 [INFO] [stderr] Checking plotters v0.3.7 [INFO] [stderr] Checking jiff v0.2.15 [INFO] [stderr] Checking approx v0.5.1 [INFO] [stderr] Checking image v0.25.6 [INFO] [stderr] Checking regex-automata v0.4.9 [INFO] [stderr] Checking num-rational v0.4.2 [INFO] [stderr] Checking num v0.4.3 [INFO] [stderr] Checking jxl-threadpool v1.0.0 [INFO] [stderr] Checking jxl-modular v0.11.0 [INFO] [stderr] Checking jxl-color v0.11.0 [INFO] [stderr] Checking clap v4.5.41 [INFO] [stderr] Checking regex v1.11.1 [INFO] [stderr] Compiling serde_spanned v0.6.9 [INFO] [stderr] Compiling toml_datetime v0.6.11 [INFO] [stderr] Compiling toml_edit v0.22.27 [INFO] [stderr] Checking env_filter v0.1.3 [INFO] [stderr] Checking jxl-vardct v0.11.0 [INFO] [stderr] Checking backtrace v0.3.75 [INFO] [stderr] Checking jxl-frame v0.13.1 [INFO] [stderr] Checking jxl-jbr v0.2.0 [INFO] [stderr] Checking jxl-render v0.12.1 [INFO] [stderr] Compiling proc-macro-crate v3.3.0 [INFO] [stderr] Compiling toml v0.8.23 [INFO] [stderr] Checking env_logger v0.11.8 [INFO] [stderr] Compiling serde_derive v1.0.219 [INFO] [stderr] Compiling zerocopy-derive v0.8.26 [INFO] [stderr] Compiling multiversion-macros v0.8.0 [INFO] [stderr] Compiling thiserror-impl v2.0.12 [INFO] [stderr] Compiling enumn v0.1.14 [INFO] [stderr] Compiling num_enum_derive v0.7.4 [INFO] [stderr] Compiling rawler v0.7.2 (/opt/rustwide/workdir) [INFO] [stderr] Checking jxl-oxide v0.12.2 [INFO] [stderr] Checking num_enum v0.7.4 [INFO] [stderr] Checking thiserror v2.0.12 [INFO] [stderr] Checking multiversion v0.8.0 [INFO] [stderr] Checking zerocopy v0.8.26 [INFO] [stderr] Checking ahash v0.8.12 [INFO] [stderr] Checking hashbrown v0.14.5 [INFO] [stderr] Checking libflate_lz77 v2.1.0 [INFO] [stderr] Checking libflate v2.1.0 [INFO] [stderr] Checking uuid v1.17.0 [INFO] [stderr] Checking serde_json v1.0.141 [INFO] [stderr] Checking ciborium v0.2.2 [INFO] [stderr] Checking serde_yaml v0.8.26 [INFO] [stderr] Checking tinytemplate v1.2.1 [INFO] [stderr] Checking criterion v0.7.0 [INFO] [stdout] warning: redundant field names in struct initialization [INFO] [stdout] --> src/rawimage.rs:466:7 [INFO] [stdout] | [INFO] [stdout] 466 | height: height, [INFO] [stdout] | ^^^^^^^^^^^^^^ help: replace it with: `height` [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/rawimage.rs:466:7 [INFO] [stdout] | [INFO] [stdout] 466 | height: height, [INFO] [stdout] | ^^^^^^^^^^^^^^ help: replace it with: `height` [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: this `impl` can be derived [INFO] [stdout] --> src/bits.rs:65:1 [INFO] [stdout] | [INFO] [stdout] 65 | / impl Default for Endian { [INFO] [stdout] 66 | | fn default() -> Self { [INFO] [stdout] 67 | | Self::Little [INFO] [stdout] 68 | | } [INFO] [stdout] 69 | | } [INFO] [stdout] | |_^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#derivable_impls [INFO] [stdout] = note: `#[warn(clippy::derivable_impls)]` on by default [INFO] [stdout] help: replace the manual implementation with a derive attribute and mark the default variant [INFO] [stdout] | [INFO] [stdout] 60 + #[derive(Default)] [INFO] [stdout] 61 | pub enum Endian { [INFO] [stdout] 62 | Big, [INFO] [stdout] 63 ~ #[default] [INFO] [stdout] 64 ~ Little, [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this `repeat().take()` can be written more concisely [INFO] [stdout] --> src/bits.rs:234:23 [INFO] [stdout] | [INFO] [stdout] 234 | expanded.extend(repeat(table.last().expect("Need one element")).take((1 << bits) - table.len())); [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: consider using `repeat_n()` instead: `std::iter::repeat_n(table.last().expect("Need one element"), (1 << bits) - table.len())` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#manual_repeat_n [INFO] [stdout] = note: `#[warn(clippy::manual_repeat_n)]` on by default [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: unneeded `return` statement [INFO] [stdout] --> src/bits.rs:351:3 [INFO] [stdout] | [INFO] [stdout] 351 | return (sign << WIDE::SIGN_BIT_POS) | (wide_exponent << WIDE::EXPONENT_POS) | wide_fraction; [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] 351 - return (sign << WIDE::SIGN_BIT_POS) | (wide_exponent << WIDE::EXPONENT_POS) | wide_fraction; [INFO] [stdout] 351 + (sign << WIDE::SIGN_BIT_POS) | (wide_exponent << WIDE::EXPONENT_POS) | wide_fraction [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this `impl` can be derived [INFO] [stdout] --> src/cfa.rs:30:1 [INFO] [stdout] | [INFO] [stdout] 30 | / impl Default for CFAColor { [INFO] [stdout] 31 | | fn default() -> Self { [INFO] [stdout] 32 | | Self::UNKNOWN [INFO] [stdout] 33 | | } [INFO] [stdout] 34 | | } [INFO] [stdout] | |_^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#derivable_impls [INFO] [stdout] help: replace the manual implementation with a derive attribute and mark the default variant [INFO] [stdout] | [INFO] [stdout] 16 + #[derive(Default)] [INFO] [stdout] 17 | pub enum CFAColor { [INFO] [stdout] 18 | // see also DngDecoder [INFO] [stdout] ... [INFO] [stdout] 27 | END, // keep it last! [INFO] [stdout] 28 ~ #[default] [INFO] [stdout] 29 ~ UNKNOWN = 255, [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: manual checked division [INFO] [stdout] --> src/cfa.rs:126:8 [INFO] [stdout] | [INFO] [stdout] 126 | if width > 0 { [INFO] [stdout] | ^^^^^^^^^ check performed here [INFO] [stdout] ... [INFO] [stdout] 129 | pattern[i / width][i % width] = CFAColor::try_from(c).expect("Invalid CFA pattern") as u8; [INFO] [stdout] | --------- division performed here [INFO] [stdout] | [INFO] [stdout] = help: consider using `checked_div` [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#manual_checked_ops [INFO] [stdout] = note: `#[warn(clippy::manual_checked_ops)]` on by default [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this `if` statement can be collapsed [INFO] [stdout] --> src/decoders/arw.rs:214:5 [INFO] [stdout] | [INFO] [stdout] 214 | / if let Some(preview_off) = root.get_entry(ExifTag::JPEGInterchangeFormat) { [INFO] [stdout] 215 | | if let Some(preview_len) = root.get_entry(ExifTag::JPEGInterchangeFormatLength) { [INFO] [stdout] 216 | | let buf = file.subview(preview_off.force_u64(0), preview_len.force_u64(0))?; [INFO] [stdout] 217 | | let img = image::load_from_memory_with_format(buf, image::ImageFormat::Jpeg) [INFO] [stdout] ... | [INFO] [stdout] 221 | | } [INFO] [stdout] | |_____^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#collapsible_if [INFO] [stdout] = note: `#[warn(clippy::collapsible_if)]` on by default [INFO] [stdout] help: collapse nested if block [INFO] [stdout] | [INFO] [stdout] 214 ~ if let Some(preview_off) = root.get_entry(ExifTag::JPEGInterchangeFormat) [INFO] [stdout] 215 ~ && let Some(preview_len) = root.get_entry(ExifTag::JPEGInterchangeFormatLength) { [INFO] [stdout] 216 | let buf = file.subview(preview_off.force_u64(0), preview_len.force_u64(0))?; [INFO] [stdout] ... [INFO] [stdout] 219 | return Ok(Some(img)); [INFO] [stdout] 220 ~ } [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this `if` statement can be collapsed [INFO] [stdout] --> src/decoders/arw.rs:269:5 [INFO] [stdout] | [INFO] [stdout] 269 | / if let Some(Entry { [INFO] [stdout] 270 | | value: Value::Undefined(params), [INFO] [stdout] 271 | | .. [INFO] [stdout] 272 | | }) = self.makernote.get_entry(ArwMakernoteTag::Tag_9050) [INFO] [stdout] ... | [INFO] [stdout] 285 | | } [INFO] [stdout] | |_____^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#collapsible_if [INFO] [stdout] help: collapse nested if block [INFO] [stdout] | [INFO] [stdout] 272 ~ }) = self.makernote.get_entry(ArwMakernoteTag::Tag_9050) [INFO] [stdout] 273 ~ && params.len() >= 263 + 2 { [INFO] [stdout] 274 | let dechiphered_9050 = sony_tag9cxx_decipher(params); [INFO] [stdout] ... [INFO] [stdout] 282 | return Ok(resolver.resolve()); [INFO] [stdout] 283 ~ } [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: useless use of `format!` [INFO] [stdout] --> src/decoders/cr2.rs:321:53 [INFO] [stdout] | [INFO] [stdout] 321 | .ok_or_else(|| RawlerError::DecoderFailed(format!("Failed to read uncompressed image")))?, [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: consider using `.to_string()`: `"Failed to read uncompressed image".to_string()` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#useless_format [INFO] [stdout] = note: `#[warn(clippy::useless_format)]` on by default [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this `if` statement can be collapsed [INFO] [stdout] --> src/decoders/cr2.rs:573:5 [INFO] [stdout] | [INFO] [stdout] 573 | / if let Some(colordata) = self.makernote.as_ref().and_then(|mn| mn.get_entry(Cr2MakernoteTag::ColorData)) { [INFO] [stdout] 574 | | if let Some(blacklevel) = colordata::parse_colordata(colordata)?.blacklevel { [INFO] [stdout] 575 | | match cpp { [INFO] [stdout] 576 | | 1 => return Ok(Some(BlackLevel::new(&blacklevel, cam.cfa.width, cam.cfa.height, cpp))), [INFO] [stdout] ... | [INFO] [stdout] 585 | | } [INFO] [stdout] | |_____^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#collapsible_if [INFO] [stdout] help: collapse nested if block [INFO] [stdout] | [INFO] [stdout] 573 ~ if let Some(colordata) = self.makernote.as_ref().and_then(|mn| mn.get_entry(Cr2MakernoteTag::ColorData)) [INFO] [stdout] 574 ~ && let Some(blacklevel) = colordata::parse_colordata(colordata)?.blacklevel { [INFO] [stdout] 575 | match cpp { [INFO] [stdout] ... [INFO] [stdout] 583 | } [INFO] [stdout] 584 ~ } [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this `if` statement can be collapsed [INFO] [stdout] --> src/decoders/cr2.rs:592:5 [INFO] [stdout] | [INFO] [stdout] 592 | / if let Some(colordata) = self.makernote.as_ref().and_then(|mn| mn.get_entry(Cr2MakernoteTag::ColorData)) { [INFO] [stdout] 593 | | if let Some(whitelevel) = colordata::parse_colordata(colordata)?.specular_whitelevel { [INFO] [stdout] 594 | | return Ok(Some(WhiteLevel(vec![whitelevel as u32; cpp]))); [INFO] [stdout] 595 | | } [INFO] [stdout] 596 | | } [INFO] [stdout] | |_____^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#collapsible_if [INFO] [stdout] help: collapse nested if block [INFO] [stdout] | [INFO] [stdout] 592 ~ if let Some(colordata) = self.makernote.as_ref().and_then(|mn| mn.get_entry(Cr2MakernoteTag::ColorData)) [INFO] [stdout] 593 ~ && let Some(whitelevel) = colordata::parse_colordata(colordata)?.specular_whitelevel { [INFO] [stdout] 594 | return Ok(Some(WhiteLevel(vec![whitelevel as u32; cpp]))); [INFO] [stdout] 595 ~ } [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: useless use of `format!` [INFO] [stdout] --> src/decoders/cr3.rs:284:49 [INFO] [stdout] | [INFO] [stdout] 284 | .ok_or_else(|| RawlerError::DecoderFailed(format!("stbl sample not found")))?; [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: consider using `.to_string()`: `"stbl sample not found".to_string()` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#useless_format [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this `if` statement can be collapsed [INFO] [stdout] --> src/decoders/cr3.rs:465:5 [INFO] [stdout] | [INFO] [stdout] 465 | / if let Some(Entry { [INFO] [stdout] 466 | | value: crate::formats::tiff::Value::Byte(v), [INFO] [stdout] 467 | | .. [INFO] [stdout] 468 | | }) = self.cmt3.get_entry(Cr3MakernoteTag::ImgUniqueID) [INFO] [stdout] ... | [INFO] [stdout] 474 | | } [INFO] [stdout] | |_____^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#collapsible_if [INFO] [stdout] help: collapse nested if block [INFO] [stdout] | [INFO] [stdout] 468 ~ }) = self.cmt3.get_entry(Cr3MakernoteTag::ImgUniqueID) [INFO] [stdout] 469 ~ && v.len() == 16 { [INFO] [stdout] 470 | debug!("CR3 makernote ImgUniqueID: {:x?}", v); [INFO] [stdout] 471 | md.image_unique_id = Some(v.as_slice().try_into().expect("Invalid slice size")); [INFO] [stdout] 472 ~ } [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this `if` statement can be collapsed [INFO] [stdout] --> src/decoders/crw.rs:127:5 [INFO] [stdout] | [INFO] [stdout] 127 | / if !self.camera.find_hint("nocinfo2") { [INFO] [stdout] 128 | | if let Some(cinfo) = self.ciff.find_entry(CiffTag::ColorInfo2) { [INFO] [stdout] 129 | | return Ok(if cinfo.get_u32(0) > 512 { [INFO] [stdout] 130 | | [cinfo.get_f32(62), cinfo.get_f32(63), cinfo.get_f32(60), cinfo.get_f32(61)] [INFO] [stdout] ... | [INFO] [stdout] 136 | | } [INFO] [stdout] | |_____^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#collapsible_if [INFO] [stdout] help: collapse nested if block [INFO] [stdout] | [INFO] [stdout] 127 ~ if !self.camera.find_hint("nocinfo2") [INFO] [stdout] 128 ~ && let Some(cinfo) = self.ciff.find_entry(CiffTag::ColorInfo2) { [INFO] [stdout] 129 | return Ok(if cinfo.get_u32(0) > 512 { [INFO] [stdout] ... [INFO] [stdout] 134 | }); [INFO] [stdout] 135 ~ } [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: useless use of `format!` [INFO] [stdout] --> src/decoders/dcr.rs:58:49 [INFO] [stdout] | [INFO] [stdout] 58 | .ok_or_else(|| RawlerError::DecoderFailed(format!("Failed to find a IFD with CFAPattern tag")))?; [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: consider using `.to_string()`: `"Failed to find a IFD with CFAPattern tag".to_string()` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#useless_format [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: useless use of `format!` [INFO] [stdout] --> src/decoders/dcs.rs:42:49 [INFO] [stdout] | [INFO] [stdout] 42 | .ok_or_else(|| RawlerError::DecoderFailed(format!("Failed to find IFD with subfile type 0")))?; [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: consider using `.to_string()`: `"Failed to find IFD with subfile type 0".to_string()` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#useless_format [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: useless use of `format!` [INFO] [stdout] --> src/decoders/dng.rs:225:38 [INFO] [stdout] | [INFO] [stdout] 225 | Err(RawlerError::DecoderFailed(format!("TODO: Unsupported DNG compression"))) [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: consider using `.to_string()`: `"TODO: Unsupported DNG compression".to_string()` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#useless_format [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: manual implementation of `Option::map` [INFO] [stdout] --> src/decoders/dng.rs:375:5 [INFO] [stdout] | [INFO] [stdout] 375 | / if let Some(rect) = self.get_active_area_borders(raw) { [INFO] [stdout] 376 | | Some(Rect::new_with_dng(&rect).as_ltrb_offsets(width, height)) [INFO] [stdout] 377 | | } else { [INFO] [stdout] 378 | | None [INFO] [stdout] 379 | | } [INFO] [stdout] | |_____^ help: try: `self.get_active_area_borders(raw).map(|rect| Rect::new_with_dng(&rect).as_ltrb_offsets(width, height))` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#manual_map [INFO] [stdout] = note: `#[warn(clippy::manual_map)]` on by default [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: useless use of `format!` [INFO] [stdout] --> src/decoders/erf.rs:64:49 [INFO] [stdout] | [INFO] [stdout] 64 | .ok_or_else(|| RawlerError::DecoderFailed(format!("Failed to find a IFD with CFAPattern tag")))?; [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: consider using `.to_string()`: `"Failed to find a IFD with CFAPattern tag".to_string()` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#useless_format [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: manual implementation of `.is_multiple_of()` [INFO] [stdout] --> src/decoders/iiq.rs:529:46 [INFO] [stdout] | [INFO] [stdout] 529 | let wide: usize = head[2] / head[4] + ((head[2] % head[4] != 0) as usize); [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^ help: replace with: `!head[2].is_multiple_of(head[4])` [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: manual implementation of `.is_multiple_of()` [INFO] [stdout] --> src/decoders/iiq.rs:530:46 [INFO] [stdout] | [INFO] [stdout] 530 | let high: usize = head[3] / head[5] + ((head[3] % head[5] != 0) as usize); [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^ help: replace with: `!head[3].is_multiple_of(head[5])` [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: useless use of `format!` [INFO] [stdout] --> src/decoders/kdc.rs:116:49 [INFO] [stdout] | [INFO] [stdout] 116 | .ok_or_else(|| RawlerError::DecoderFailed(format!("Failed to find a IFD with KdcWidth tag")))?; [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: consider using `.to_string()`: `"Failed to find a IFD with KdcWidth tag".to_string()` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#useless_format [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: useless use of `format!` [INFO] [stdout] --> src/decoders/mef.rs:40:49 [INFO] [stdout] | [INFO] [stdout] 40 | .ok_or_else(|| RawlerError::DecoderFailed(format!("Failed to find a IFD with CFAPattern tag")))?; [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: consider using `.to_string()`: `"Failed to find a IFD with CFAPattern tag".to_string()` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#useless_format [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: useless use of `format!` [INFO] [stdout] --> src/decoders/mos.rs:48:49 [INFO] [stdout] | [INFO] [stdout] 48 | .ok_or_else(|| RawlerError::DecoderFailed(format!("Failed to find a IFD with TileOffsets tag")))?; [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: consider using `.to_string()`: `"Failed to find a IFD with TileOffsets tag".to_string()` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#useless_format [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: the variable `ck` is used as a loop counter [INFO] [stdout] --> src/decoders/nef/decrypt.rs:32:3 [INFO] [stdout] | [INFO] [stdout] 32 | for i in 0..src.len() { [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^ help: consider using: `for (ck, i) in (0x60_u32..).zip((0..src.len()))` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#explicit_counter_loop [INFO] [stdout] = note: `#[warn(clippy::explicit_counter_loop)]` on by default [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: useless use of `format!` [INFO] [stdout] --> src/decoders/nef.rs:151:49 [INFO] [stdout] | [INFO] [stdout] 151 | .ok_or_else(|| RawlerError::DecoderFailed(format!("Failed to find a suitable IFD in NEF decoder")))?; [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: consider using `.to_string()`: `"Failed to find a suitable IFD in NEF decoder".to_string()` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#useless_format [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: useless use of `format!` [INFO] [stdout] --> src/decoders/nef.rs:183:49 [INFO] [stdout] | [INFO] [stdout] 183 | .ok_or_else(|| RawlerError::DecoderFailed(format!("Failed to find a suitable IFD in NEF decoder")))?; [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: consider using `.to_string()`: `"Failed to find a suitable IFD in NEF decoder".to_string()` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#useless_format [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: unneeded `return` statement [INFO] [stdout] --> src/decoders/nef.rs:351:7 [INFO] [stdout] | [INFO] [stdout] 351 | return Ok(Some(dynamic_image_from_jpeg_interchange_format(jpeg_ifd, file)?)); [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] 351 - return Ok(Some(dynamic_image_from_jpeg_interchange_format(jpeg_ifd, file)?)); [INFO] [stdout] 351 + Ok(Some(dynamic_image_from_jpeg_interchange_format(jpeg_ifd, file)?)) [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this `if` statement can be collapsed [INFO] [stdout] --> src/decoders/nef.rs:395:5 [INFO] [stdout] | [INFO] [stdout] 395 | / if let Some(lensdata) = lensdata::from_makernote(&self.makernote)? { [INFO] [stdout] 396 | | if let Some(lenstype) = self.makernote.get_entry(NikonMakernote::LensType) { [INFO] [stdout] 397 | | match lensdata { [INFO] [stdout] 398 | | NefLensData::FMount(oldv) => { [INFO] [stdout] ... | [INFO] [stdout] 416 | | } [INFO] [stdout] | |_____^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#collapsible_if [INFO] [stdout] help: collapse nested if block [INFO] [stdout] | [INFO] [stdout] 395 ~ if let Some(lensdata) = lensdata::from_makernote(&self.makernote)? [INFO] [stdout] 396 ~ && let Some(lenstype) = self.makernote.get_entry(NikonMakernote::LensType) { [INFO] [stdout] 397 | match lensdata { [INFO] [stdout] ... [INFO] [stdout] 414 | } [INFO] [stdout] 415 ~ } [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: the variable `ck` is used as a loop counter [INFO] [stdout] --> src/decoders/nef.rs:498:11 [INFO] [stdout] | [INFO] [stdout] 498 | for i in 0..280 { [INFO] [stdout] | ^^^^^^^^^^^^^^^ help: consider using: `for (ck, i) in (0x60_u32..).zip((0..280))` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#explicit_counter_loop [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: manual implementation of `.is_multiple_of()` [INFO] [stdout] --> src/decoders/nef.rs:559:10 [INFO] [stdout] | [INFO] [stdout] 559 | if total_padding % height != 0 { [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: replace with: `!total_padding.is_multiple_of(height)` [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: useless use of `format!` [INFO] [stdout] --> src/decoders/orf.rs:147:49 [INFO] [stdout] | [INFO] [stdout] 147 | .ok_or_else(|| RawlerError::DecoderFailed(format!("Failed to find a IFD with StripOffsets tag")))?; [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: consider using `.to_string()`: `"Failed to find a IFD with StripOffsets tag".to_string()` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#useless_format [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: manual implementation of an assign operation [INFO] [stdout] --> src/decoders/orf.rs:227:52 [INFO] [stdout] | [INFO] [stdout] 227 | img.whitelevel.0.iter_mut().for_each(|level| *level = *level << 2); [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^ help: replace it with: `*level <<= 2` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#assign_op_pattern [INFO] [stdout] = note: `#[warn(clippy::assign_op_pattern)]` on by default [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: manual implementation of an assign operation [INFO] [stdout] --> src/decoders/orf.rs:362:42 [INFO] [stdout] | [INFO] [stdout] 362 | levels.iter_mut().for_each(|level| *level = *level << 2); [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^ help: replace it with: `*level <<= 2` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#assign_op_pattern [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this `if` statement can be collapsed [INFO] [stdout] --> src/decoders/orf.rs:417:5 [INFO] [stdout] | [INFO] [stdout] 417 | / if let Some(exif) = self.tiff.find_first_ifd_with_tag(ExifTag::MakerNotes) { [INFO] [stdout] 418 | | if let Some(Entry { [INFO] [stdout] 419 | | value: Value::Short(focal), .. [INFO] [stdout] 420 | | }) = exif.get_entry(ExifTag::FocalLength) [INFO] [stdout] ... | [INFO] [stdout] 424 | | } [INFO] [stdout] | |_____^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#collapsible_if [INFO] [stdout] help: collapse nested if block [INFO] [stdout] | [INFO] [stdout] 417 ~ if let Some(exif) = self.tiff.find_first_ifd_with_tag(ExifTag::MakerNotes) [INFO] [stdout] 418 ~ && let Some(Entry { [INFO] [stdout] 419 | value: Value::Short(focal), .. [INFO] [stdout] ... [INFO] [stdout] 422 | return Ok(focal.get(1).map(|v| Rational::new(*v as u32, 1))); [INFO] [stdout] 423 ~ } [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: manual implementation of `.is_multiple_of()` [INFO] [stdout] --> src/decoders/raf/fuji_decompressor.rs:143:10 [INFO] [stdout] | [INFO] [stdout] 143 | || (self.raw_height as usize) % Strip::line_height() != 0 [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: replace with: `!(self.raw_height as usize).is_multiple_of(Strip::line_height())` [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: manual implementation of `.is_multiple_of()` [INFO] [stdout] --> src/decoders/raf/fuji_decompressor.rs:146:10 [INFO] [stdout] | [INFO] [stdout] 146 | || self.raw_width % 24 != 0 [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^ help: replace with: `!self.raw_width.is_multiple_of(24)` [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: manual implementation of `.is_multiple_of()` [INFO] [stdout] --> src/decoders/raf/fuji_decompressor.rs:150:10 [INFO] [stdout] | [INFO] [stdout] 150 | || self.raw_rounded_width % self.block_size != 0 [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: replace with: `!self.raw_rounded_width.is_multiple_of(self.block_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: the variable `cur_val` is used as a loop counter [INFO] [stdout] --> src/decoders/raf/fuji_decompressor.rs:740:5 [INFO] [stdout] | [INFO] [stdout] 740 | for qt in qtable.iter_mut() { [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: consider using: `for (cur_val, qt) in (-(qp[4] as i32)..).zip(qtable.iter_mut())` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#explicit_counter_loop [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: manual implementation of `.is_multiple_of()` [INFO] [stdout] --> src/decoders/raf/fuji_decompressor.rs:798:9 [INFO] [stdout] | [INFO] [stdout] 798 | if (header.block_size % 3 != 0 && header.raw_type == 16) || (header.block_size & 1 != 0 && header.raw_type == 0) { [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^^ help: replace with: `!header.block_size.is_multiple_of(3)` [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: this `impl` can be derived [INFO] [stdout] --> src/bits.rs:65:1 [INFO] [stdout] | [INFO] [stdout] 65 | / impl Default for Endian { [INFO] [stdout] 66 | | fn default() -> Self { [INFO] [stdout] 67 | | Self::Little [INFO] [stdout] 68 | | } [INFO] [stdout] 69 | | } [INFO] [stdout] | |_^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#derivable_impls [INFO] [stdout] = note: `#[warn(clippy::derivable_impls)]` on by default [INFO] [stdout] help: replace the manual implementation with a derive attribute and mark the default variant [INFO] [stdout] | [INFO] [stdout] 60 + #[derive(Default)] [INFO] [stdout] 61 | pub enum Endian { [INFO] [stdout] 62 | Big, [INFO] [stdout] 63 ~ #[default] [INFO] [stdout] 64 ~ Little, [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this `repeat().take()` can be written more concisely [INFO] [stdout] --> src/bits.rs:234:23 [INFO] [stdout] | [INFO] [stdout] 234 | expanded.extend(repeat(table.last().expect("Need one element")).take((1 << bits) - table.len())); [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: consider using `repeat_n()` instead: `std::iter::repeat_n(table.last().expect("Need one element"), (1 << bits) - table.len())` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#manual_repeat_n [INFO] [stdout] = note: `#[warn(clippy::manual_repeat_n)]` on by default [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: unneeded `return` statement [INFO] [stdout] --> src/bits.rs:351:3 [INFO] [stdout] | [INFO] [stdout] 351 | return (sign << WIDE::SIGN_BIT_POS) | (wide_exponent << WIDE::EXPONENT_POS) | wide_fraction; [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] 351 - return (sign << WIDE::SIGN_BIT_POS) | (wide_exponent << WIDE::EXPONENT_POS) | wide_fraction; [INFO] [stdout] 351 + (sign << WIDE::SIGN_BIT_POS) | (wide_exponent << WIDE::EXPONENT_POS) | wide_fraction [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this `impl` can be derived [INFO] [stdout] --> src/cfa.rs:30:1 [INFO] [stdout] | [INFO] [stdout] 30 | / impl Default for CFAColor { [INFO] [stdout] 31 | | fn default() -> Self { [INFO] [stdout] 32 | | Self::UNKNOWN [INFO] [stdout] 33 | | } [INFO] [stdout] 34 | | } [INFO] [stdout] | |_^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#derivable_impls [INFO] [stdout] help: replace the manual implementation with a derive attribute and mark the default variant [INFO] [stdout] | [INFO] [stdout] 16 + #[derive(Default)] [INFO] [stdout] 17 | pub enum CFAColor { [INFO] [stdout] 18 | // see also DngDecoder [INFO] [stdout] ... [INFO] [stdout] 27 | END, // keep it last! [INFO] [stdout] 28 ~ #[default] [INFO] [stdout] 29 ~ UNKNOWN = 255, [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: manual checked division [INFO] [stdout] --> src/cfa.rs:126:8 [INFO] [stdout] | [INFO] [stdout] 126 | if width > 0 { [INFO] [stdout] | ^^^^^^^^^ check performed here [INFO] [stdout] ... [INFO] [stdout] 129 | pattern[i / width][i % width] = CFAColor::try_from(c).expect("Invalid CFA pattern") as u8; [INFO] [stdout] | --------- division performed here [INFO] [stdout] | [INFO] [stdout] = help: consider using `checked_div` [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#manual_checked_ops [INFO] [stdout] = note: `#[warn(clippy::manual_checked_ops)]` on by default [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: manually reimplementing `div_ceil` [INFO] [stdout] --> src/decoders/rw2/v8decompressor.rs:385:81 [INFO] [stdout] | [INFO] [stdout] 385 | bitstreams.push(rawfile.subview(params.strip_byte_offsets[strip_id] as u64, (params.strip_data_size[strip_id] as u64 + 7) / 8)?); [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: consider using `.div_ceil()`: `(params.strip_data_size[strip_id] as u64).div_ceil(8)` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#manual_div_ceil [INFO] [stdout] = note: `#[warn(clippy::manual_div_ceil)]` on by default [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this `if` statement can be collapsed [INFO] [stdout] --> src/decoders/arw.rs:214:5 [INFO] [stdout] | [INFO] [stdout] 214 | / if let Some(preview_off) = root.get_entry(ExifTag::JPEGInterchangeFormat) { [INFO] [stdout] 215 | | if let Some(preview_len) = root.get_entry(ExifTag::JPEGInterchangeFormatLength) { [INFO] [stdout] 216 | | let buf = file.subview(preview_off.force_u64(0), preview_len.force_u64(0))?; [INFO] [stdout] 217 | | let img = image::load_from_memory_with_format(buf, image::ImageFormat::Jpeg) [INFO] [stdout] ... | [INFO] [stdout] 221 | | } [INFO] [stdout] | |_____^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#collapsible_if [INFO] [stdout] = note: `#[warn(clippy::collapsible_if)]` on by default [INFO] [stdout] help: collapse nested if block [INFO] [stdout] | [INFO] [stdout] 214 ~ if let Some(preview_off) = root.get_entry(ExifTag::JPEGInterchangeFormat) [INFO] [stdout] 215 ~ && let Some(preview_len) = root.get_entry(ExifTag::JPEGInterchangeFormatLength) { [INFO] [stdout] 216 | let buf = file.subview(preview_off.force_u64(0), preview_len.force_u64(0))?; [INFO] [stdout] ... [INFO] [stdout] 219 | return Ok(Some(img)); [INFO] [stdout] 220 ~ } [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this `if` statement can be collapsed [INFO] [stdout] --> src/decoders/arw.rs:269:5 [INFO] [stdout] | [INFO] [stdout] 269 | / if let Some(Entry { [INFO] [stdout] 270 | | value: Value::Undefined(params), [INFO] [stdout] 271 | | .. [INFO] [stdout] 272 | | }) = self.makernote.get_entry(ArwMakernoteTag::Tag_9050) [INFO] [stdout] ... | [INFO] [stdout] 285 | | } [INFO] [stdout] | |_____^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#collapsible_if [INFO] [stdout] help: collapse nested if block [INFO] [stdout] | [INFO] [stdout] 272 ~ }) = self.makernote.get_entry(ArwMakernoteTag::Tag_9050) [INFO] [stdout] 273 ~ && params.len() >= 263 + 2 { [INFO] [stdout] 274 | let dechiphered_9050 = sony_tag9cxx_decipher(params); [INFO] [stdout] ... [INFO] [stdout] 282 | return Ok(resolver.resolve()); [INFO] [stdout] 283 ~ } [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: useless use of `format!` [INFO] [stdout] --> src/decoders/rw2.rs:68:53 [INFO] [stdout] | [INFO] [stdout] 68 | .ok_or_else(|| RawlerError::DecoderFailed(format!("Failed to find a IFD with StripOffsets tag")))? [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: consider using `.to_string()`: `"Failed to find a IFD with StripOffsets tag".to_string()` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#useless_format [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: manual implementation of `ok` [INFO] [stdout] --> src/decoders/rw2.rs:91:7 [INFO] [stdout] | [INFO] [stdout] 91 | / match IFD::new_root(&mut std::io::Cursor::new(buf), 0) { [INFO] [stdout] 92 | | Ok(ifd) => Some(ifd), [INFO] [stdout] 93 | | Err(_) => None, [INFO] [stdout] 94 | | } [INFO] [stdout] | |_______^ help: replace with: `IFD::new_root(&mut std::io::Cursor::new(buf), 0).ok()` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#manual_ok_err [INFO] [stdout] = note: `#[warn(clippy::manual_ok_err)]` on by default [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: useless use of `format!` [INFO] [stdout] --> src/decoders/rw2.rs:122:55 [INFO] [stdout] | [INFO] [stdout] 122 | .ok_or_else(|| RawlerError::DecoderFailed(format!("Failed to find a IFD with StripOffsets tag")))?, [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: consider using `.to_string()`: `"Failed to find a IFD with StripOffsets tag".to_string()` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#useless_format [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: useless use of `format!` [INFO] [stdout] --> src/decoders/rw2.rs:151:53 [INFO] [stdout] | [INFO] [stdout] 151 | .ok_or_else(|| RawlerError::DecoderFailed(format!("Failed to find a IFD with StripOffsets tag")))?; [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: consider using `.to_string()`: `"Failed to find a IFD with StripOffsets tag".to_string()` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#useless_format [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this `if` statement can be collapsed [INFO] [stdout] --> src/decoders/rw2.rs:277:5 [INFO] [stdout] | [INFO] [stdout] 277 | / if let Some(ifd) = &self.camera_ifd { [INFO] [stdout] 278 | | if ifd.has_entry(CameraIfdTag::LensTypeMake) && ifd.has_entry(CameraIfdTag::LensTypeModel) { [INFO] [stdout] 279 | | let make_id = fetch_tiff_tag!(ifd, CameraIfdTag::LensTypeMake); [INFO] [stdout] 280 | | let model_id = fetch_tiff_tag!(ifd, CameraIfdTag::LensTypeModel); [INFO] [stdout] ... | [INFO] [stdout] 300 | | } [INFO] [stdout] | |_____^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#collapsible_if [INFO] [stdout] help: collapse nested if block [INFO] [stdout] | [INFO] [stdout] 277 ~ if let Some(ifd) = &self.camera_ifd [INFO] [stdout] 278 ~ && ifd.has_entry(CameraIfdTag::LensTypeMake) && ifd.has_entry(CameraIfdTag::LensTypeModel) { [INFO] [stdout] 279 | let make_id = fetch_tiff_tag!(ifd, CameraIfdTag::LensTypeMake); [INFO] [stdout] ... [INFO] [stdout] 298 | } [INFO] [stdout] 299 ~ } [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this `if` statement can be collapsed [INFO] [stdout] --> src/decoders/rw2.rs:306:5 [INFO] [stdout] | [INFO] [stdout] 306 | / if let Some(exif) = self.tiff.find_first_ifd_with_tag(ExifTag::MakerNotes) { [INFO] [stdout] 307 | | if let Some(Entry { [INFO] [stdout] 308 | | value: Value::Short(focal), .. [INFO] [stdout] 309 | | }) = exif.get_entry(ExifTag::FocalLength) [INFO] [stdout] ... | [INFO] [stdout] 313 | | } [INFO] [stdout] | |_____^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#collapsible_if [INFO] [stdout] help: collapse nested if block [INFO] [stdout] | [INFO] [stdout] 306 ~ if let Some(exif) = self.tiff.find_first_ifd_with_tag(ExifTag::MakerNotes) [INFO] [stdout] 307 ~ && let Some(Entry { [INFO] [stdout] 308 | value: Value::Short(focal), .. [INFO] [stdout] ... [INFO] [stdout] 311 | return Ok(focal.get(1).map(|v| Rational::new(*v as u32, 1))); [INFO] [stdout] 312 ~ } [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: useless use of `format!` [INFO] [stdout] --> src/decoders/srw.rs:75:49 [INFO] [stdout] | [INFO] [stdout] 75 | .ok_or_else(|| RawlerError::DecoderFailed(format!("Failed to find a IFD with StripOffsets tag")))?; [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: consider using `.to_string()`: `"Failed to find a IFD with StripOffsets tag".to_string()` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#useless_format [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: useless use of `format!` [INFO] [stdout] --> src/decoders/tfr.rs:55:49 [INFO] [stdout] | [INFO] [stdout] 55 | .ok_or_else(|| RawlerError::DecoderFailed(format!("Failed to find a IFD with WhilteLevel tag")))?; [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: consider using `.to_string()`: `"Failed to find a IFD with WhilteLevel tag".to_string()` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#useless_format [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this `if` statement can be collapsed [INFO] [stdout] --> src/decoders/tfr.rs:124:5 [INFO] [stdout] | [INFO] [stdout] 124 | / if let Some(Entry { [INFO] [stdout] 125 | | value: Value::Byte(unique_id), .. [INFO] [stdout] 126 | | }) = self.tiff.root_ifd().get_entry(DngTag::RawDataUniqueID) [INFO] [stdout] ... | [INFO] [stdout] 131 | | } [INFO] [stdout] | |_____^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#collapsible_if [INFO] [stdout] help: collapse nested if block [INFO] [stdout] | [INFO] [stdout] 126 ~ }) = self.tiff.root_ifd().get_entry(DngTag::RawDataUniqueID) [INFO] [stdout] 127 ~ && let Ok(id) = unique_id.as_slice().try_into() { [INFO] [stdout] 128 | mdata.unique_image_id = Some(u128::from_le_bytes(id)); [INFO] [stdout] 129 ~ } [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: useless use of `format!` [INFO] [stdout] --> src/decoders/cr2.rs:321:53 [INFO] [stdout] | [INFO] [stdout] 321 | .ok_or_else(|| RawlerError::DecoderFailed(format!("Failed to read uncompressed image")))?, [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: consider using `.to_string()`: `"Failed to read uncompressed image".to_string()` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#useless_format [INFO] [stdout] = note: `#[warn(clippy::useless_format)]` on by default [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this `if` statement can be collapsed [INFO] [stdout] --> src/decoders/cr2.rs:573:5 [INFO] [stdout] | [INFO] [stdout] 573 | / if let Some(colordata) = self.makernote.as_ref().and_then(|mn| mn.get_entry(Cr2MakernoteTag::ColorData)) { [INFO] [stdout] 574 | | if let Some(blacklevel) = colordata::parse_colordata(colordata)?.blacklevel { [INFO] [stdout] 575 | | match cpp { [INFO] [stdout] 576 | | 1 => return Ok(Some(BlackLevel::new(&blacklevel, cam.cfa.width, cam.cfa.height, cpp))), [INFO] [stdout] ... | [INFO] [stdout] 585 | | } [INFO] [stdout] | |_____^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#collapsible_if [INFO] [stdout] help: collapse nested if block [INFO] [stdout] | [INFO] [stdout] 573 ~ if let Some(colordata) = self.makernote.as_ref().and_then(|mn| mn.get_entry(Cr2MakernoteTag::ColorData)) [INFO] [stdout] 574 ~ && let Some(blacklevel) = colordata::parse_colordata(colordata)?.blacklevel { [INFO] [stdout] 575 | match cpp { [INFO] [stdout] ... [INFO] [stdout] 583 | } [INFO] [stdout] 584 ~ } [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this `if` statement can be collapsed [INFO] [stdout] --> src/decoders/cr2.rs:592:5 [INFO] [stdout] | [INFO] [stdout] 592 | / if let Some(colordata) = self.makernote.as_ref().and_then(|mn| mn.get_entry(Cr2MakernoteTag::ColorData)) { [INFO] [stdout] 593 | | if let Some(whitelevel) = colordata::parse_colordata(colordata)?.specular_whitelevel { [INFO] [stdout] 594 | | return Ok(Some(WhiteLevel(vec![whitelevel as u32; cpp]))); [INFO] [stdout] 595 | | } [INFO] [stdout] 596 | | } [INFO] [stdout] | |_____^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#collapsible_if [INFO] [stdout] help: collapse nested if block [INFO] [stdout] | [INFO] [stdout] 592 ~ if let Some(colordata) = self.makernote.as_ref().and_then(|mn| mn.get_entry(Cr2MakernoteTag::ColorData)) [INFO] [stdout] 593 ~ && let Some(whitelevel) = colordata::parse_colordata(colordata)?.specular_whitelevel { [INFO] [stdout] 594 | return Ok(Some(WhiteLevel(vec![whitelevel as u32; cpp]))); [INFO] [stdout] 595 ~ } [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this `impl` can be derived [INFO] [stdout] --> src/decoders/mod.rs:234:1 [INFO] [stdout] | [INFO] [stdout] 234 | / impl Default for FormatHint { [INFO] [stdout] 235 | | fn default() -> Self { [INFO] [stdout] 236 | | Self::Unknown [INFO] [stdout] 237 | | } [INFO] [stdout] 238 | | } [INFO] [stdout] | |_^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#derivable_impls [INFO] [stdout] help: replace the manual implementation with a derive attribute and mark the default variant [INFO] [stdout] | [INFO] [stdout] 206 + #[derive(Default)] [INFO] [stdout] 207 | pub enum FormatHint { [INFO] [stdout] 208 ~ #[default] [INFO] [stdout] 209 ~ Unknown, [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: useless use of `format!` [INFO] [stdout] --> src/decoders/mod.rs:525:49 [INFO] [stdout] | [INFO] [stdout] 525 | .ok_or(RawlerError::DecoderFailed(format!("Create RGB thumbnail from strip failed")))?, [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: consider using `.to_string()`: `"Create RGB thumbnail from strip failed".to_string()` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#useless_format [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: useless use of `format!` [INFO] [stdout] --> src/decoders/mod.rs:529:49 [INFO] [stdout] | [INFO] [stdout] 529 | .ok_or(RawlerError::DecoderFailed(format!("Create RGB thumbnail from strip failed")))?, [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: consider using `.to_string()`: `"Create RGB thumbnail from strip failed".to_string()` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#useless_format [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: useless use of `format!` [INFO] [stdout] --> src/decoders/mod.rs:543:49 [INFO] [stdout] | [INFO] [stdout] 543 | .ok_or(RawlerError::DecoderFailed(format!("Create Y image failed")))?, [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: consider using `.to_string()`: `"Create Y image failed".to_string()` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#useless_format [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: useless use of `format!` [INFO] [stdout] --> src/decoders/mod.rs:547:49 [INFO] [stdout] | [INFO] [stdout] 547 | .ok_or(RawlerError::DecoderFailed(format!("Create RGB image failed")))?, [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: consider using `.to_string()`: `"Create RGB image failed".to_string()` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#useless_format [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: useless use of `format!` [INFO] [stdout] --> src/decoders/mod.rs:558:45 [INFO] [stdout] | [INFO] [stdout] 558 | .ok_or(RawlerError::DecoderFailed(format!("Create RGB image failed")))?, [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: consider using `.to_string()`: `"Create RGB image failed".to_string()` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#useless_format [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this boolean expression can be simplified [INFO] [stdout] --> src/decoders/mod.rs:607:14 [INFO] [stdout] | [INFO] [stdout] 607 | if (pi == PhotometricInterpretation::YCbCr && bits == 8) || (pi == PhotometricInterpretation::BlackIsZero && bits == 8) { [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] 607 - if (pi == PhotometricInterpretation::YCbCr && bits == 8) || (pi == PhotometricInterpretation::BlackIsZero && bits == 8) { [INFO] [stdout] 607 + if !(bits != 8 || pi != PhotometricInterpretation::YCbCr && pi != PhotometricInterpretation::BlackIsZero) { [INFO] [stdout] | [INFO] [stdout] 607 - if (pi == PhotometricInterpretation::YCbCr && bits == 8) || (pi == PhotometricInterpretation::BlackIsZero && bits == 8) { [INFO] [stdout] 607 + if (pi == PhotometricInterpretation::BlackIsZero || pi == PhotometricInterpretation::YCbCr) && bits == 8 { [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this boolean expression can be simplified [INFO] [stdout] --> src/decoders/mod.rs:614:14 [INFO] [stdout] | [INFO] [stdout] 614 | if (pi == PhotometricInterpretation::YCbCr && bits == 8) || (pi == PhotometricInterpretation::BlackIsZero && bits == 8) { [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] help: try [INFO] [stdout] | [INFO] [stdout] 614 - if (pi == PhotometricInterpretation::YCbCr && bits == 8) || (pi == PhotometricInterpretation::BlackIsZero && bits == 8) { [INFO] [stdout] 614 + if !(bits != 8 || pi != PhotometricInterpretation::YCbCr && pi != PhotometricInterpretation::BlackIsZero) { [INFO] [stdout] | [INFO] [stdout] 614 - if (pi == PhotometricInterpretation::YCbCr && bits == 8) || (pi == PhotometricInterpretation::BlackIsZero && bits == 8) { [INFO] [stdout] 614 + if (pi == PhotometricInterpretation::BlackIsZero || pi == PhotometricInterpretation::YCbCr) && bits == 8 { [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: unneeded `return` statement [INFO] [stdout] --> src/decoders/mod.rs:656:7 [INFO] [stdout] | [INFO] [stdout] 656 | return Ok(RawImageData::Integer(pixbuf.into_inner())); [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] 656 - return Ok(RawImageData::Integer(pixbuf.into_inner())); [INFO] [stdout] 656 + Ok(RawImageData::Integer(pixbuf.into_inner())) [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: unneeded `return` statement [INFO] [stdout] --> src/decoders/mod.rs:687:7 [INFO] [stdout] | [INFO] [stdout] 687 | return Ok(RawImageData::Float(pixbuf.into_inner())); [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] 687 - return Ok(RawImageData::Float(pixbuf.into_inner())); [INFO] [stdout] 687 + Ok(RawImageData::Float(pixbuf.into_inner())) [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: useless use of `format!` [INFO] [stdout] --> src/decoders/cr3.rs:284:49 [INFO] [stdout] | [INFO] [stdout] 284 | .ok_or_else(|| RawlerError::DecoderFailed(format!("stbl sample not found")))?; [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: consider using `.to_string()`: `"stbl sample not found".to_string()` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#useless_format [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this `if` statement can be collapsed [INFO] [stdout] --> src/decoders/cr3.rs:465:5 [INFO] [stdout] | [INFO] [stdout] 465 | / if let Some(Entry { [INFO] [stdout] 466 | | value: crate::formats::tiff::Value::Byte(v), [INFO] [stdout] 467 | | .. [INFO] [stdout] 468 | | }) = self.cmt3.get_entry(Cr3MakernoteTag::ImgUniqueID) [INFO] [stdout] ... | [INFO] [stdout] 474 | | } [INFO] [stdout] | |_____^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#collapsible_if [INFO] [stdout] help: collapse nested if block [INFO] [stdout] | [INFO] [stdout] 468 ~ }) = self.cmt3.get_entry(Cr3MakernoteTag::ImgUniqueID) [INFO] [stdout] 469 ~ && v.len() == 16 { [INFO] [stdout] 470 | debug!("CR3 makernote ImgUniqueID: {:x?}", v); [INFO] [stdout] 471 | md.image_unique_id = Some(v.as_slice().try_into().expect("Invalid slice size")); [INFO] [stdout] 472 ~ } [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: useless use of `format!` [INFO] [stdout] --> src/decoders/mod.rs:744:45 [INFO] [stdout] | [INFO] [stdout] 744 | .map_err(|_| RawlerError::DecoderFailed(format!("Unable to divide source image into tiles")))?; [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: consider using `.to_string()`: `"Unable to divide source image into tiles".to_string()` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#useless_format [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this `if` statement can be collapsed [INFO] [stdout] --> src/decoders/mod.rs:924:9 [INFO] [stdout] | [INFO] [stdout] 924 | / if let Some(model) = tiff.get_entry(TiffCommonTag::Model) { [INFO] [stdout] 925 | | if model.get_string().ok() == Some(&String::from("DCS560C")) { [INFO] [stdout] 926 | | return use_decoder!(cr2::Cr2Decoder, rawfile, tiff, self); [INFO] [stdout] 927 | | } [INFO] [stdout] 928 | | } [INFO] [stdout] | |_________^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#collapsible_if [INFO] [stdout] help: collapse nested if block [INFO] [stdout] | [INFO] [stdout] 924 ~ if let Some(model) = tiff.get_entry(TiffCommonTag::Model) [INFO] [stdout] 925 ~ && model.get_string().ok() == Some(&String::from("DCS560C")) { [INFO] [stdout] 926 | return use_decoder!(cr2::Cr2Decoder, rawfile, tiff, self); [INFO] [stdout] 927 ~ } [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this `if` statement can be collapsed [INFO] [stdout] --> src/decoders/crw.rs:127:5 [INFO] [stdout] | [INFO] [stdout] 127 | / if !self.camera.find_hint("nocinfo2") { [INFO] [stdout] 128 | | if let Some(cinfo) = self.ciff.find_entry(CiffTag::ColorInfo2) { [INFO] [stdout] 129 | | return Ok(if cinfo.get_u32(0) > 512 { [INFO] [stdout] 130 | | [cinfo.get_f32(62), cinfo.get_f32(63), cinfo.get_f32(60), cinfo.get_f32(61)] [INFO] [stdout] ... | [INFO] [stdout] 136 | | } [INFO] [stdout] | |_____^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#collapsible_if [INFO] [stdout] help: collapse nested if block [INFO] [stdout] | [INFO] [stdout] 127 ~ if !self.camera.find_hint("nocinfo2") [INFO] [stdout] 128 ~ && let Some(cinfo) = self.ciff.find_entry(CiffTag::ColorInfo2) { [INFO] [stdout] 129 | return Ok(if cinfo.get_u32(0) > 512 { [INFO] [stdout] ... [INFO] [stdout] 134 | }); [INFO] [stdout] 135 ~ } [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: useless use of `format!` [INFO] [stdout] --> src/decoders/dcr.rs:58:49 [INFO] [stdout] | [INFO] [stdout] 58 | .ok_or_else(|| RawlerError::DecoderFailed(format!("Failed to find a IFD with CFAPattern tag")))?; [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: consider using `.to_string()`: `"Failed to find a IFD with CFAPattern tag".to_string()` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#useless_format [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: useless use of `format!` [INFO] [stdout] --> src/decoders/dcs.rs:42:49 [INFO] [stdout] | [INFO] [stdout] 42 | .ok_or_else(|| RawlerError::DecoderFailed(format!("Failed to find IFD with subfile type 0")))?; [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: consider using `.to_string()`: `"Failed to find IFD with subfile type 0".to_string()` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#useless_format [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: useless use of `format!` [INFO] [stdout] --> src/decoders/dng.rs:225:38 [INFO] [stdout] | [INFO] [stdout] 225 | Err(RawlerError::DecoderFailed(format!("TODO: Unsupported DNG compression"))) [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: consider using `.to_string()`: `"TODO: Unsupported DNG compression".to_string()` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#useless_format [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: manual implementation of `Option::map` [INFO] [stdout] --> src/decoders/dng.rs:375:5 [INFO] [stdout] | [INFO] [stdout] 375 | / if let Some(rect) = self.get_active_area_borders(raw) { [INFO] [stdout] 376 | | Some(Rect::new_with_dng(&rect).as_ltrb_offsets(width, height)) [INFO] [stdout] 377 | | } else { [INFO] [stdout] 378 | | None [INFO] [stdout] 379 | | } [INFO] [stdout] | |_____^ help: try: `self.get_active_area_borders(raw).map(|rect| Rect::new_with_dng(&rect).as_ltrb_offsets(width, height))` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#manual_map [INFO] [stdout] = note: `#[warn(clippy::manual_map)]` on by default [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: useless use of `format!` [INFO] [stdout] --> src/decoders/erf.rs:64:49 [INFO] [stdout] | [INFO] [stdout] 64 | .ok_or_else(|| RawlerError::DecoderFailed(format!("Failed to find a IFD with CFAPattern tag")))?; [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: consider using `.to_string()`: `"Failed to find a IFD with CFAPattern tag".to_string()` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#useless_format [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: the variable `row0_idx` is used as a loop counter [INFO] [stdout] --> src/decompressors/crx/iquant.rs:174:13 [INFO] [stdout] | [INFO] [stdout] 174 | for _qp_col in 0..qp_width { [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^^ help: consider using: `for (row0_idx, _qp_col) in (qp_width * std::cmp::min(4 * qp_row + 0, qp_height - 1)..).zip((0..qp_width))` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#explicit_counter_loop [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: the variable `row1_idx` is used as a loop counter [INFO] [stdout] --> src/decompressors/crx/iquant.rs:174:13 [INFO] [stdout] | [INFO] [stdout] 174 | for _qp_col in 0..qp_width { [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^^ help: consider using: `for (row1_idx, _qp_col) in (qp_width * std::cmp::min(4 * qp_row + 1, qp_height - 1)..).zip((0..qp_width))` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#explicit_counter_loop [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: the variable `row2_idx` is used as a loop counter [INFO] [stdout] --> src/decompressors/crx/iquant.rs:174:13 [INFO] [stdout] | [INFO] [stdout] 174 | for _qp_col in 0..qp_width { [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^^ help: consider using: `for (row2_idx, _qp_col) in (qp_width * std::cmp::min(4 * qp_row + 2, qp_height - 1)..).zip((0..qp_width))` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#explicit_counter_loop [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: the variable `row3_idx` is used as a loop counter [INFO] [stdout] --> src/decompressors/crx/iquant.rs:174:13 [INFO] [stdout] | [INFO] [stdout] 174 | for _qp_col in 0..qp_width { [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^^ help: consider using: `for (row3_idx, _qp_col) in (qp_width * std::cmp::min(4 * qp_row + 3, qp_height - 1)..).zip((0..qp_width))` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#explicit_counter_loop [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: the variable `row0_idx` is used as a loop counter [INFO] [stdout] --> src/decompressors/crx/iquant.rs:200:13 [INFO] [stdout] | [INFO] [stdout] 200 | for _qp_col in 0..qp_width { [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^^ help: consider using: `for (row0_idx, _qp_col) in (qp_width * std::cmp::min(2 * qp_row + 0, qp_height - 1)..).zip((0..qp_width))` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#explicit_counter_loop [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: the variable `row1_idx` is used as a loop counter [INFO] [stdout] --> src/decompressors/crx/iquant.rs:200:13 [INFO] [stdout] | [INFO] [stdout] 200 | for _qp_col in 0..qp_width { [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^^ help: consider using: `for (row1_idx, _qp_col) in (qp_width * std::cmp::min(2 * qp_row + 1, qp_height - 1)..).zip((0..qp_width))` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#explicit_counter_loop [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: manual implementation of `.is_multiple_of()` [INFO] [stdout] --> src/decoders/iiq.rs:529:46 [INFO] [stdout] | [INFO] [stdout] 529 | let wide: usize = head[2] / head[4] + ((head[2] % head[4] != 0) as usize); [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^ help: replace with: `!head[2].is_multiple_of(head[4])` [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: manual implementation of `.is_multiple_of()` [INFO] [stdout] --> src/decoders/iiq.rs:530:46 [INFO] [stdout] | [INFO] [stdout] 530 | let high: usize = head[3] / head[5] + ((head[3] % head[5] != 0) as usize); [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^ help: replace with: `!head[3].is_multiple_of(head[5])` [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: manual `RangeInclusive::contains` implementation [INFO] [stdout] --> src/decompressors/deflate.rs:56:13 [INFO] [stdout] | [INFO] [stdout] 56 | assert!(bytesps >= 2 && bytesps <= 4); [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: use: `(2..=4).contains(&bytesps)` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#manual_range_contains [INFO] [stdout] = note: `#[warn(clippy::manual_range_contains)]` on by default [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: you should consider adding a `Default` implementation for `LJpegDecompressor` [INFO] [stdout] --> src/decompressors/jpeg.rs:7:3 [INFO] [stdout] | [INFO] [stdout] 7 | / pub fn new() -> Self { [INFO] [stdout] 8 | | Self {} [INFO] [stdout] 9 | | } [INFO] [stdout] | |___^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#new_without_default [INFO] [stdout] = note: `#[warn(clippy::new_without_default)]` on by default [INFO] [stdout] help: try adding this [INFO] [stdout] | [INFO] [stdout] 6 + impl Default for LJpegDecompressor { [INFO] [stdout] 7 + fn default() -> Self { [INFO] [stdout] 8 + Self::new() [INFO] [stdout] 9 + } [INFO] [stdout] 10 + } [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: you should consider adding a `Default` implementation for `JpegDecompressor` [INFO] [stdout] --> src/decompressors/jpeg.rs:34:3 [INFO] [stdout] | [INFO] [stdout] 34 | / pub fn new() -> Self { [INFO] [stdout] 35 | | Self {} [INFO] [stdout] 36 | | } [INFO] [stdout] | |___^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#new_without_default [INFO] [stdout] help: try adding this [INFO] [stdout] | [INFO] [stdout] 33 + impl Default for JpegDecompressor { [INFO] [stdout] 34 + fn default() -> Self { [INFO] [stdout] 35 + Self::new() [INFO] [stdout] 36 + } [INFO] [stdout] 37 + } [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this `if` statement can be collapsed [INFO] [stdout] --> src/decompressors/jpegxl.rs:23:5 [INFO] [stdout] | [INFO] [stdout] 23 | / if let Some(header) = image.frame_header(0) { [INFO] [stdout] 24 | | if header.bit_depth.bits_per_sample() != 8 && header.bit_depth.bits_per_sample() != 16 { [INFO] [stdout] ... | [INFO] [stdout] 31 | | } [INFO] [stdout] | |_____^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#collapsible_if [INFO] [stdout] help: collapse nested if block [INFO] [stdout] | [INFO] [stdout] 23 ~ if let Some(header) = image.frame_header(0) [INFO] [stdout] 24 ~ && header.bit_depth.bits_per_sample() != 8 && header.bit_depth.bits_per_sample() != 16 { [INFO] [stdout] 25 | // jxl_oxide scales the pixels into full range of storage type. [INFO] [stdout] ... [INFO] [stdout] 29 | } [INFO] [stdout] 30 ~ //eprintln!("JPEG-XL Bit-Depth: {:?}", header.bit_depth); [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: useless use of `format!` [INFO] [stdout] --> src/decoders/kdc.rs:116:49 [INFO] [stdout] | [INFO] [stdout] 116 | .ok_or_else(|| RawlerError::DecoderFailed(format!("Failed to find a IFD with KdcWidth tag")))?; [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: consider using `.to_string()`: `"Failed to find a IFD with KdcWidth tag".to_string()` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#useless_format [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: useless use of `format!` [INFO] [stdout] --> src/decoders/mef.rs:40:49 [INFO] [stdout] | [INFO] [stdout] 40 | .ok_or_else(|| RawlerError::DecoderFailed(format!("Failed to find a IFD with CFAPattern tag")))?; [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: consider using `.to_string()`: `"Failed to find a IFD with CFAPattern tag".to_string()` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#useless_format [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: useless use of `format!` [INFO] [stdout] --> src/decoders/mos.rs:48:49 [INFO] [stdout] | [INFO] [stdout] 48 | .ok_or_else(|| RawlerError::DecoderFailed(format!("Failed to find a IFD with TileOffsets tag")))?; [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: consider using `.to_string()`: `"Failed to find a IFD with TileOffsets tag".to_string()` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#useless_format [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: the variable `ck` is used as a loop counter [INFO] [stdout] --> src/decoders/nef/decrypt.rs:32:3 [INFO] [stdout] | [INFO] [stdout] 32 | for i in 0..src.len() { [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^ help: consider using: `for (ck, i) in (0x60_u32..).zip((0..src.len()))` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#explicit_counter_loop [INFO] [stdout] = note: `#[warn(clippy::explicit_counter_loop)]` on by default [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: unneeded `return` statement [INFO] [stdout] --> src/decompressors/ljpeg/mod.rs:304:7 [INFO] [stdout] | [INFO] [stdout] 304 | return decode_ljpeg_422(self, out, width, height); [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] 304 - return decode_ljpeg_422(self, out, width, height); [INFO] [stdout] 304 + decode_ljpeg_422(self, out, width, height) [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: useless use of `format!` [INFO] [stdout] --> src/decoders/nef.rs:151:49 [INFO] [stdout] | [INFO] [stdout] 151 | .ok_or_else(|| RawlerError::DecoderFailed(format!("Failed to find a suitable IFD in NEF decoder")))?; [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: consider using `.to_string()`: `"Failed to find a suitable IFD in NEF decoder".to_string()` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#useless_format [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: useless use of `format!` [INFO] [stdout] --> src/decoders/nef.rs:183:49 [INFO] [stdout] | [INFO] [stdout] 183 | .ok_or_else(|| RawlerError::DecoderFailed(format!("Failed to find a suitable IFD in NEF decoder")))?; [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: consider using `.to_string()`: `"Failed to find a suitable IFD in NEF decoder".to_string()` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#useless_format [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: unneeded `return` statement [INFO] [stdout] --> src/decoders/nef.rs:351:7 [INFO] [stdout] | [INFO] [stdout] 351 | return Ok(Some(dynamic_image_from_jpeg_interchange_format(jpeg_ifd, file)?)); [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] 351 - return Ok(Some(dynamic_image_from_jpeg_interchange_format(jpeg_ifd, file)?)); [INFO] [stdout] 351 + Ok(Some(dynamic_image_from_jpeg_interchange_format(jpeg_ifd, file)?)) [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this `if` statement can be collapsed [INFO] [stdout] --> src/decoders/nef.rs:395:5 [INFO] [stdout] | [INFO] [stdout] 395 | / if let Some(lensdata) = lensdata::from_makernote(&self.makernote)? { [INFO] [stdout] 396 | | if let Some(lenstype) = self.makernote.get_entry(NikonMakernote::LensType) { [INFO] [stdout] 397 | | match lensdata { [INFO] [stdout] 398 | | NefLensData::FMount(oldv) => { [INFO] [stdout] ... | [INFO] [stdout] 416 | | } [INFO] [stdout] | |_____^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#collapsible_if [INFO] [stdout] help: collapse nested if block [INFO] [stdout] | [INFO] [stdout] 395 ~ if let Some(lensdata) = lensdata::from_makernote(&self.makernote)? [INFO] [stdout] 396 ~ && let Some(lenstype) = self.makernote.get_entry(NikonMakernote::LensType) { [INFO] [stdout] 397 | match lensdata { [INFO] [stdout] ... [INFO] [stdout] 414 | } [INFO] [stdout] 415 ~ } [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: the variable `ck` is used as a loop counter [INFO] [stdout] --> src/decoders/nef.rs:498:11 [INFO] [stdout] | [INFO] [stdout] 498 | for i in 0..280 { [INFO] [stdout] | ^^^^^^^^^^^^^^^ help: consider using: `for (ck, i) in (0x60_u32..).zip((0..280))` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#explicit_counter_loop [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: manual implementation of `.is_multiple_of()` [INFO] [stdout] --> src/decoders/nef.rs:559:10 [INFO] [stdout] | [INFO] [stdout] 559 | if total_padding % height != 0 { [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: replace with: `!total_padding.is_multiple_of(height)` [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: this `if` statement can be collapsed [INFO] [stdout] --> src/dng/convert.rs:180:3 [INFO] [stdout] | [INFO] [stdout] 180 | / if let Some(Entry { [INFO] [stdout] 181 | | value: crate::formats::tiff::Value::Short(v), [INFO] [stdout] 182 | | .. [INFO] [stdout] 183 | | }) = decoder [INFO] [stdout] ... | [INFO] [stdout] 190 | | } [INFO] [stdout] | |___^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#collapsible_if [INFO] [stdout] help: collapse nested if block [INFO] [stdout] | [INFO] [stdout] 185 ~ .and_then(|ifd| ifd.get_entry(DngTag::MakerNoteSafety).cloned()) [INFO] [stdout] 186 ~ && v.get(0).copied().unwrap_or(0) == 0 { [INFO] [stdout] 187 | dng.exif_ifd_mut().remove_tag(ExifTag::MakerNotes); [INFO] [stdout] 188 ~ } [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this can be `std::io::Error::other(_)` [INFO] [stdout] --> src/dng/convert.rs:199:22 [INFO] [stdout] | [INFO] [stdout] 199 | .map_err(|err| std::io::Error::new(std::io::ErrorKind::Other, format!("Failed to join compression thread: {:?}", 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] = note: `#[warn(clippy::io_other_error)]` on by default [INFO] [stdout] help: use `std::io::Error::other` [INFO] [stdout] | [INFO] [stdout] 199 - .map_err(|err| std::io::Error::new(std::io::ErrorKind::Other, format!("Failed to join compression thread: {:?}", err)))??; [INFO] [stdout] 199 + .map_err(|err| std::io::Error::other(format!("Failed to join compression thread: {:?}", err)))??; [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: useless use of `format!` [INFO] [stdout] --> src/decoders/orf.rs:147:49 [INFO] [stdout] | [INFO] [stdout] 147 | .ok_or_else(|| RawlerError::DecoderFailed(format!("Failed to find a IFD with StripOffsets tag")))?; [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: consider using `.to_string()`: `"Failed to find a IFD with StripOffsets tag".to_string()` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#useless_format [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: manual implementation of an assign operation [INFO] [stdout] --> src/decoders/orf.rs:227:52 [INFO] [stdout] | [INFO] [stdout] 227 | img.whitelevel.0.iter_mut().for_each(|level| *level = *level << 2); [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^ help: replace it with: `*level <<= 2` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#assign_op_pattern [INFO] [stdout] = note: `#[warn(clippy::assign_op_pattern)]` on by default [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this can be `std::io::Error::other(_)` [INFO] [stdout] --> src/dng/writer.rs:347:22 [INFO] [stdout] | [INFO] [stdout] 347 | .map_err(|err| io::Error::new(io::ErrorKind::Other, format!("Failed to write jpeg preview: {:?}", 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] 347 - .map_err(|err| io::Error::new(io::ErrorKind::Other, format!("Failed to write jpeg preview: {:?}", err)))?; [INFO] [stdout] 347 + .map_err(|err| io::Error::other(format!("Failed to write jpeg preview: {:?}", err)))?; [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: manual implementation of an assign operation [INFO] [stdout] --> src/decoders/orf.rs:362:42 [INFO] [stdout] | [INFO] [stdout] 362 | levels.iter_mut().for_each(|level| *level = *level << 2); [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^ help: replace it with: `*level <<= 2` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#assign_op_pattern [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this `if` statement can be collapsed [INFO] [stdout] --> src/decoders/orf.rs:417:5 [INFO] [stdout] | [INFO] [stdout] 417 | / if let Some(exif) = self.tiff.find_first_ifd_with_tag(ExifTag::MakerNotes) { [INFO] [stdout] 418 | | if let Some(Entry { [INFO] [stdout] 419 | | value: Value::Short(focal), .. [INFO] [stdout] 420 | | }) = exif.get_entry(ExifTag::FocalLength) [INFO] [stdout] ... | [INFO] [stdout] 424 | | } [INFO] [stdout] | |_____^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#collapsible_if [INFO] [stdout] help: collapse nested if block [INFO] [stdout] | [INFO] [stdout] 417 ~ if let Some(exif) = self.tiff.find_first_ifd_with_tag(ExifTag::MakerNotes) [INFO] [stdout] 418 ~ && let Some(Entry { [INFO] [stdout] 419 | value: Value::Short(focal), .. [INFO] [stdout] ... [INFO] [stdout] 422 | return Ok(focal.get(1).map(|v| Rational::new(*v as u32, 1))); [INFO] [stdout] 423 ~ } [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this `impl` can be derived [INFO] [stdout] --> src/dng/mod.rs:61:1 [INFO] [stdout] | [INFO] [stdout] 61 | / impl Default for DngPhotometricConversion { [INFO] [stdout] 62 | | fn default() -> Self { [INFO] [stdout] 63 | | Self::Original [INFO] [stdout] 64 | | } [INFO] [stdout] 65 | | } [INFO] [stdout] | |_^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#derivable_impls [INFO] [stdout] help: replace the manual implementation with a derive attribute and mark the default variant [INFO] [stdout] | [INFO] [stdout] 56 + #[derive(Default)] [INFO] [stdout] 57 | pub enum DngPhotometricConversion { [INFO] [stdout] 58 ~ #[default] [INFO] [stdout] 59 ~ Original, [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: manual implementation of `.is_multiple_of()` [INFO] [stdout] --> src/decoders/raf/fuji_decompressor.rs:143:10 [INFO] [stdout] | [INFO] [stdout] 143 | || (self.raw_height as usize) % Strip::line_height() != 0 [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: replace with: `!(self.raw_height as usize).is_multiple_of(Strip::line_height())` [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: manual implementation of `.is_multiple_of()` [INFO] [stdout] --> src/decoders/raf/fuji_decompressor.rs:146:10 [INFO] [stdout] | [INFO] [stdout] 146 | || self.raw_width % 24 != 0 [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^ help: replace with: `!self.raw_width.is_multiple_of(24)` [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: manual implementation of `.is_multiple_of()` [INFO] [stdout] --> src/decoders/raf/fuji_decompressor.rs:150:10 [INFO] [stdout] | [INFO] [stdout] 150 | || self.raw_rounded_width % self.block_size != 0 [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: replace with: `!self.raw_rounded_width.is_multiple_of(self.block_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: the variable `cur_val` is used as a loop counter [INFO] [stdout] --> src/decoders/raf/fuji_decompressor.rs:740:5 [INFO] [stdout] | [INFO] [stdout] 740 | for qt in qtable.iter_mut() { [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: consider using: `for (cur_val, qt) in (-(qp[4] as i32)..).zip(qtable.iter_mut())` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#explicit_counter_loop [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: manual implementation of `.is_multiple_of()` [INFO] [stdout] --> src/decoders/raf/fuji_decompressor.rs:798:9 [INFO] [stdout] | [INFO] [stdout] 798 | if (header.block_size % 3 != 0 && header.raw_type == 16) || (header.block_size & 1 != 0 && header.raw_type == 0) { [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^^ help: replace with: `!header.block_size.is_multiple_of(3)` [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: manually reimplementing `div_ceil` [INFO] [stdout] --> src/decoders/rw2/v8decompressor.rs:385:81 [INFO] [stdout] | [INFO] [stdout] 385 | bitstreams.push(rawfile.subview(params.strip_byte_offsets[strip_id] as u64, (params.strip_data_size[strip_id] as u64 + 7) / 8)?); [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: consider using `.div_ceil()`: `(params.strip_data_size[strip_id] as u64).div_ceil(8)` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#manual_div_ceil [INFO] [stdout] = note: `#[warn(clippy::manual_div_ceil)]` on by default [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: useless use of `format!` [INFO] [stdout] --> src/decoders/rw2.rs:68:53 [INFO] [stdout] | [INFO] [stdout] 68 | .ok_or_else(|| RawlerError::DecoderFailed(format!("Failed to find a IFD with StripOffsets tag")))? [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: consider using `.to_string()`: `"Failed to find a IFD with StripOffsets tag".to_string()` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#useless_format [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: manual implementation of `ok` [INFO] [stdout] --> src/decoders/rw2.rs:91:7 [INFO] [stdout] | [INFO] [stdout] 91 | / match IFD::new_root(&mut std::io::Cursor::new(buf), 0) { [INFO] [stdout] 92 | | Ok(ifd) => Some(ifd), [INFO] [stdout] 93 | | Err(_) => None, [INFO] [stdout] 94 | | } [INFO] [stdout] | |_______^ help: replace with: `IFD::new_root(&mut std::io::Cursor::new(buf), 0).ok()` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#manual_ok_err [INFO] [stdout] = note: `#[warn(clippy::manual_ok_err)]` on by default [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: useless use of `format!` [INFO] [stdout] --> src/decoders/rw2.rs:122:55 [INFO] [stdout] | [INFO] [stdout] 122 | .ok_or_else(|| RawlerError::DecoderFailed(format!("Failed to find a IFD with StripOffsets tag")))?, [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: consider using `.to_string()`: `"Failed to find a IFD with StripOffsets tag".to_string()` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#useless_format [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: useless use of `format!` [INFO] [stdout] --> src/decoders/rw2.rs:151:53 [INFO] [stdout] | [INFO] [stdout] 151 | .ok_or_else(|| RawlerError::DecoderFailed(format!("Failed to find a IFD with StripOffsets tag")))?; [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: consider using `.to_string()`: `"Failed to find a IFD with StripOffsets tag".to_string()` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#useless_format [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this `if` statement can be collapsed [INFO] [stdout] --> src/decoders/rw2.rs:277:5 [INFO] [stdout] | [INFO] [stdout] 277 | / if let Some(ifd) = &self.camera_ifd { [INFO] [stdout] 278 | | if ifd.has_entry(CameraIfdTag::LensTypeMake) && ifd.has_entry(CameraIfdTag::LensTypeModel) { [INFO] [stdout] 279 | | let make_id = fetch_tiff_tag!(ifd, CameraIfdTag::LensTypeMake); [INFO] [stdout] 280 | | let model_id = fetch_tiff_tag!(ifd, CameraIfdTag::LensTypeModel); [INFO] [stdout] ... | [INFO] [stdout] 300 | | } [INFO] [stdout] | |_____^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#collapsible_if [INFO] [stdout] help: collapse nested if block [INFO] [stdout] | [INFO] [stdout] 277 ~ if let Some(ifd) = &self.camera_ifd [INFO] [stdout] 278 ~ && ifd.has_entry(CameraIfdTag::LensTypeMake) && ifd.has_entry(CameraIfdTag::LensTypeModel) { [INFO] [stdout] 279 | let make_id = fetch_tiff_tag!(ifd, CameraIfdTag::LensTypeMake); [INFO] [stdout] ... [INFO] [stdout] 298 | } [INFO] [stdout] 299 ~ } [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this `if` statement can be collapsed [INFO] [stdout] --> src/decoders/rw2.rs:306:5 [INFO] [stdout] | [INFO] [stdout] 306 | / if let Some(exif) = self.tiff.find_first_ifd_with_tag(ExifTag::MakerNotes) { [INFO] [stdout] 307 | | if let Some(Entry { [INFO] [stdout] 308 | | value: Value::Short(focal), .. [INFO] [stdout] 309 | | }) = exif.get_entry(ExifTag::FocalLength) [INFO] [stdout] ... | [INFO] [stdout] 313 | | } [INFO] [stdout] | |_____^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#collapsible_if [INFO] [stdout] help: collapse nested if block [INFO] [stdout] | [INFO] [stdout] 306 ~ if let Some(exif) = self.tiff.find_first_ifd_with_tag(ExifTag::MakerNotes) [INFO] [stdout] 307 ~ && let Some(Entry { [INFO] [stdout] 308 | value: Value::Short(focal), .. [INFO] [stdout] ... [INFO] [stdout] 311 | return Ok(focal.get(1).map(|v| Rational::new(*v as u32, 1))); [INFO] [stdout] 312 ~ } [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: useless use of `format!` [INFO] [stdout] --> src/decoders/srw.rs:75:49 [INFO] [stdout] | [INFO] [stdout] 75 | .ok_or_else(|| RawlerError::DecoderFailed(format!("Failed to find a IFD with StripOffsets tag")))?; [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: consider using `.to_string()`: `"Failed to find a IFD with StripOffsets tag".to_string()` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#useless_format [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: useless use of `format!` [INFO] [stdout] --> src/decoders/tfr.rs:55:49 [INFO] [stdout] | [INFO] [stdout] 55 | .ok_or_else(|| RawlerError::DecoderFailed(format!("Failed to find a IFD with WhilteLevel tag")))?; [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: consider using `.to_string()`: `"Failed to find a IFD with WhilteLevel tag".to_string()` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#useless_format [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this `if` statement can be collapsed [INFO] [stdout] --> src/decoders/tfr.rs:124:5 [INFO] [stdout] | [INFO] [stdout] 124 | / if let Some(Entry { [INFO] [stdout] 125 | | value: Value::Byte(unique_id), .. [INFO] [stdout] 126 | | }) = self.tiff.root_ifd().get_entry(DngTag::RawDataUniqueID) [INFO] [stdout] ... | [INFO] [stdout] 131 | | } [INFO] [stdout] | |_____^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#collapsible_if [INFO] [stdout] help: collapse nested if block [INFO] [stdout] | [INFO] [stdout] 126 ~ }) = self.tiff.root_ifd().get_entry(DngTag::RawDataUniqueID) [INFO] [stdout] 127 ~ && let Ok(id) = unique_id.as_slice().try_into() { [INFO] [stdout] 128 | mdata.unique_image_id = Some(u128::from_le_bytes(id)); [INFO] [stdout] 129 ~ } [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this `impl` can be derived [INFO] [stdout] --> src/decoders/mod.rs:234:1 [INFO] [stdout] | [INFO] [stdout] 234 | / impl Default for FormatHint { [INFO] [stdout] 235 | | fn default() -> Self { [INFO] [stdout] 236 | | Self::Unknown [INFO] [stdout] 237 | | } [INFO] [stdout] 238 | | } [INFO] [stdout] | |_^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#derivable_impls [INFO] [stdout] help: replace the manual implementation with a derive attribute and mark the default variant [INFO] [stdout] | [INFO] [stdout] 206 + #[derive(Default)] [INFO] [stdout] 207 | pub enum FormatHint { [INFO] [stdout] 208 ~ #[default] [INFO] [stdout] 209 ~ Unknown, [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: useless use of `format!` [INFO] [stdout] --> src/decoders/mod.rs:525:49 [INFO] [stdout] | [INFO] [stdout] 525 | .ok_or(RawlerError::DecoderFailed(format!("Create RGB thumbnail from strip failed")))?, [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: consider using `.to_string()`: `"Create RGB thumbnail from strip failed".to_string()` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#useless_format [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: useless use of `format!` [INFO] [stdout] --> src/decoders/mod.rs:529:49 [INFO] [stdout] | [INFO] [stdout] 529 | .ok_or(RawlerError::DecoderFailed(format!("Create RGB thumbnail from strip failed")))?, [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: consider using `.to_string()`: `"Create RGB thumbnail from strip failed".to_string()` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#useless_format [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: useless use of `format!` [INFO] [stdout] --> src/decoders/mod.rs:543:49 [INFO] [stdout] | [INFO] [stdout] 543 | .ok_or(RawlerError::DecoderFailed(format!("Create Y image failed")))?, [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: consider using `.to_string()`: `"Create Y image failed".to_string()` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#useless_format [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: useless use of `format!` [INFO] [stdout] --> src/decoders/mod.rs:547:49 [INFO] [stdout] | [INFO] [stdout] 547 | .ok_or(RawlerError::DecoderFailed(format!("Create RGB image failed")))?, [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: consider using `.to_string()`: `"Create RGB image failed".to_string()` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#useless_format [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: useless use of `format!` [INFO] [stdout] --> src/decoders/mod.rs:558:45 [INFO] [stdout] | [INFO] [stdout] 558 | .ok_or(RawlerError::DecoderFailed(format!("Create RGB image failed")))?, [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: consider using `.to_string()`: `"Create RGB image failed".to_string()` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#useless_format [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this boolean expression can be simplified [INFO] [stdout] --> src/decoders/mod.rs:607:14 [INFO] [stdout] | [INFO] [stdout] 607 | if (pi == PhotometricInterpretation::YCbCr && bits == 8) || (pi == PhotometricInterpretation::BlackIsZero && bits == 8) { [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] 607 - if (pi == PhotometricInterpretation::YCbCr && bits == 8) || (pi == PhotometricInterpretation::BlackIsZero && bits == 8) { [INFO] [stdout] 607 + if !(bits != 8 || pi != PhotometricInterpretation::YCbCr && pi != PhotometricInterpretation::BlackIsZero) { [INFO] [stdout] | [INFO] [stdout] 607 - if (pi == PhotometricInterpretation::YCbCr && bits == 8) || (pi == PhotometricInterpretation::BlackIsZero && bits == 8) { [INFO] [stdout] 607 + if (pi == PhotometricInterpretation::BlackIsZero || pi == PhotometricInterpretation::YCbCr) && bits == 8 { [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this boolean expression can be simplified [INFO] [stdout] --> src/decoders/mod.rs:614:14 [INFO] [stdout] | [INFO] [stdout] 614 | if (pi == PhotometricInterpretation::YCbCr && bits == 8) || (pi == PhotometricInterpretation::BlackIsZero && bits == 8) { [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] help: try [INFO] [stdout] | [INFO] [stdout] 614 - if (pi == PhotometricInterpretation::YCbCr && bits == 8) || (pi == PhotometricInterpretation::BlackIsZero && bits == 8) { [INFO] [stdout] 614 + if !(bits != 8 || pi != PhotometricInterpretation::YCbCr && pi != PhotometricInterpretation::BlackIsZero) { [INFO] [stdout] | [INFO] [stdout] 614 - if (pi == PhotometricInterpretation::YCbCr && bits == 8) || (pi == PhotometricInterpretation::BlackIsZero && bits == 8) { [INFO] [stdout] 614 + if (pi == PhotometricInterpretation::BlackIsZero || pi == PhotometricInterpretation::YCbCr) && bits == 8 { [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: unneeded `return` statement [INFO] [stdout] --> src/decoders/mod.rs:656:7 [INFO] [stdout] | [INFO] [stdout] 656 | return Ok(RawImageData::Integer(pixbuf.into_inner())); [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] 656 - return Ok(RawImageData::Integer(pixbuf.into_inner())); [INFO] [stdout] 656 + Ok(RawImageData::Integer(pixbuf.into_inner())) [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: unneeded `return` statement [INFO] [stdout] --> src/decoders/mod.rs:687:7 [INFO] [stdout] | [INFO] [stdout] 687 | return Ok(RawImageData::Float(pixbuf.into_inner())); [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] 687 - return Ok(RawImageData::Float(pixbuf.into_inner())); [INFO] [stdout] 687 + Ok(RawImageData::Float(pixbuf.into_inner())) [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: useless use of `format!` [INFO] [stdout] --> src/decoders/mod.rs:744:45 [INFO] [stdout] | [INFO] [stdout] 744 | .map_err(|_| RawlerError::DecoderFailed(format!("Unable to divide source image into tiles")))?; [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: consider using `.to_string()`: `"Unable to divide source image into tiles".to_string()` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#useless_format [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this `if` statement can be collapsed [INFO] [stdout] --> src/decoders/mod.rs:924:9 [INFO] [stdout] | [INFO] [stdout] 924 | / if let Some(model) = tiff.get_entry(TiffCommonTag::Model) { [INFO] [stdout] 925 | | if model.get_string().ok() == Some(&String::from("DCS560C")) { [INFO] [stdout] 926 | | return use_decoder!(cr2::Cr2Decoder, rawfile, tiff, self); [INFO] [stdout] 927 | | } [INFO] [stdout] 928 | | } [INFO] [stdout] | |_________^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#collapsible_if [INFO] [stdout] help: collapse nested if block [INFO] [stdout] | [INFO] [stdout] 924 ~ if let Some(model) = tiff.get_entry(TiffCommonTag::Model) [INFO] [stdout] 925 ~ && model.get_string().ok() == Some(&String::from("DCS560C")) { [INFO] [stdout] 926 | return use_decoder!(cr2::Cr2Decoder, rawfile, tiff, self); [INFO] [stdout] 927 ~ } [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: manual implementation of `.is_multiple_of()` [INFO] [stdout] --> src/formats/bmff/ftyp.rs:26:8 [INFO] [stdout] | [INFO] [stdout] 26 | if header.size % 4 != 0 { [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^ help: replace with: `!header.size.is_multiple_of(4)` [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: the variable `row0_idx` is used as a loop counter [INFO] [stdout] --> src/decompressors/crx/iquant.rs:174:13 [INFO] [stdout] | [INFO] [stdout] 174 | for _qp_col in 0..qp_width { [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^^ help: consider using: `for (row0_idx, _qp_col) in (qp_width * std::cmp::min(4 * qp_row + 0, qp_height - 1)..).zip((0..qp_width))` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#explicit_counter_loop [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: the variable `row1_idx` is used as a loop counter [INFO] [stdout] --> src/decompressors/crx/iquant.rs:174:13 [INFO] [stdout] | [INFO] [stdout] 174 | for _qp_col in 0..qp_width { [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^^ help: consider using: `for (row1_idx, _qp_col) in (qp_width * std::cmp::min(4 * qp_row + 1, qp_height - 1)..).zip((0..qp_width))` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#explicit_counter_loop [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: the variable `row2_idx` is used as a loop counter [INFO] [stdout] --> src/decompressors/crx/iquant.rs:174:13 [INFO] [stdout] | [INFO] [stdout] 174 | for _qp_col in 0..qp_width { [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^^ help: consider using: `for (row2_idx, _qp_col) in (qp_width * std::cmp::min(4 * qp_row + 2, qp_height - 1)..).zip((0..qp_width))` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#explicit_counter_loop [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: the variable `row3_idx` is used as a loop counter [INFO] [stdout] --> src/decompressors/crx/iquant.rs:174:13 [INFO] [stdout] | [INFO] [stdout] 174 | for _qp_col in 0..qp_width { [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^^ help: consider using: `for (row3_idx, _qp_col) in (qp_width * std::cmp::min(4 * qp_row + 3, qp_height - 1)..).zip((0..qp_width))` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#explicit_counter_loop [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: the variable `row0_idx` is used as a loop counter [INFO] [stdout] --> src/decompressors/crx/iquant.rs:200:13 [INFO] [stdout] | [INFO] [stdout] 200 | for _qp_col in 0..qp_width { [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^^ help: consider using: `for (row0_idx, _qp_col) in (qp_width * std::cmp::min(2 * qp_row + 0, qp_height - 1)..).zip((0..qp_width))` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#explicit_counter_loop [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: the variable `row1_idx` is used as a loop counter [INFO] [stdout] --> src/decompressors/crx/iquant.rs:200:13 [INFO] [stdout] | [INFO] [stdout] 200 | for _qp_col in 0..qp_width { [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^^ help: consider using: `for (row1_idx, _qp_col) in (qp_width * std::cmp::min(2 * qp_row + 1, qp_height - 1)..).zip((0..qp_width))` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#explicit_counter_loop [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: manual `RangeInclusive::contains` implementation [INFO] [stdout] --> src/decompressors/deflate.rs:56:13 [INFO] [stdout] | [INFO] [stdout] 56 | assert!(bytesps >= 2 && bytesps <= 4); [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: use: `(2..=4).contains(&bytesps)` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#manual_range_contains [INFO] [stdout] = note: `#[warn(clippy::manual_range_contains)]` on by default [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: you should consider adding a `Default` implementation for `LJpegDecompressor` [INFO] [stdout] --> src/decompressors/jpeg.rs:7:3 [INFO] [stdout] | [INFO] [stdout] 7 | / pub fn new() -> Self { [INFO] [stdout] 8 | | Self {} [INFO] [stdout] 9 | | } [INFO] [stdout] | |___^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#new_without_default [INFO] [stdout] = note: `#[warn(clippy::new_without_default)]` on by default [INFO] [stdout] help: try adding this [INFO] [stdout] | [INFO] [stdout] 6 + impl Default for LJpegDecompressor { [INFO] [stdout] 7 + fn default() -> Self { [INFO] [stdout] 8 + Self::new() [INFO] [stdout] 9 + } [INFO] [stdout] 10 + } [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: you should consider adding a `Default` implementation for `JpegDecompressor` [INFO] [stdout] --> src/decompressors/jpeg.rs:34:3 [INFO] [stdout] | [INFO] [stdout] 34 | / pub fn new() -> Self { [INFO] [stdout] 35 | | Self {} [INFO] [stdout] 36 | | } [INFO] [stdout] | |___^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#new_without_default [INFO] [stdout] help: try adding this [INFO] [stdout] | [INFO] [stdout] 33 + impl Default for JpegDecompressor { [INFO] [stdout] 34 + fn default() -> Self { [INFO] [stdout] 35 + Self::new() [INFO] [stdout] 36 + } [INFO] [stdout] 37 + } [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this `if` statement can be collapsed [INFO] [stdout] --> src/decompressors/jpegxl.rs:23:5 [INFO] [stdout] | [INFO] [stdout] 23 | / if let Some(header) = image.frame_header(0) { [INFO] [stdout] 24 | | if header.bit_depth.bits_per_sample() != 8 && header.bit_depth.bits_per_sample() != 16 { [INFO] [stdout] ... | [INFO] [stdout] 31 | | } [INFO] [stdout] | |_____^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#collapsible_if [INFO] [stdout] help: collapse nested if block [INFO] [stdout] | [INFO] [stdout] 23 ~ if let Some(header) = image.frame_header(0) [INFO] [stdout] 24 ~ && header.bit_depth.bits_per_sample() != 8 && header.bit_depth.bits_per_sample() != 16 { [INFO] [stdout] 25 | // jxl_oxide scales the pixels into full range of storage type. [INFO] [stdout] ... [INFO] [stdout] 29 | } [INFO] [stdout] 30 ~ //eprintln!("JPEG-XL Bit-Depth: {:?}", header.bit_depth); [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: unneeded `return` statement [INFO] [stdout] --> src/decompressors/ljpeg/mod.rs:304:7 [INFO] [stdout] | [INFO] [stdout] 304 | return decode_ljpeg_422(self, out, width, height); [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] 304 - return decode_ljpeg_422(self, out, width, height); [INFO] [stdout] 304 + decode_ljpeg_422(self, out, width, height) [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this `if` statement can be collapsed [INFO] [stdout] --> src/dng/convert.rs:180:3 [INFO] [stdout] | [INFO] [stdout] 180 | / if let Some(Entry { [INFO] [stdout] 181 | | value: crate::formats::tiff::Value::Short(v), [INFO] [stdout] 182 | | .. [INFO] [stdout] 183 | | }) = decoder [INFO] [stdout] ... | [INFO] [stdout] 190 | | } [INFO] [stdout] | |___^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#collapsible_if [INFO] [stdout] help: collapse nested if block [INFO] [stdout] | [INFO] [stdout] 185 ~ .and_then(|ifd| ifd.get_entry(DngTag::MakerNoteSafety).cloned()) [INFO] [stdout] 186 ~ && v.get(0).copied().unwrap_or(0) == 0 { [INFO] [stdout] 187 | dng.exif_ifd_mut().remove_tag(ExifTag::MakerNotes); [INFO] [stdout] 188 ~ } [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this can be `std::io::Error::other(_)` [INFO] [stdout] --> src/dng/convert.rs:199:22 [INFO] [stdout] | [INFO] [stdout] 199 | .map_err(|err| std::io::Error::new(std::io::ErrorKind::Other, format!("Failed to join compression thread: {:?}", 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] = note: `#[warn(clippy::io_other_error)]` on by default [INFO] [stdout] help: use `std::io::Error::other` [INFO] [stdout] | [INFO] [stdout] 199 - .map_err(|err| std::io::Error::new(std::io::ErrorKind::Other, format!("Failed to join compression thread: {:?}", err)))??; [INFO] [stdout] 199 + .map_err(|err| std::io::Error::other(format!("Failed to join compression thread: {:?}", err)))??; [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this can be `std::io::Error::other(_)` [INFO] [stdout] --> src/dng/writer.rs:347:22 [INFO] [stdout] | [INFO] [stdout] 347 | .map_err(|err| io::Error::new(io::ErrorKind::Other, format!("Failed to write jpeg preview: {:?}", 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] 347 - .map_err(|err| io::Error::new(io::ErrorKind::Other, format!("Failed to write jpeg preview: {:?}", err)))?; [INFO] [stdout] 347 + .map_err(|err| io::Error::other(format!("Failed to write jpeg preview: {:?}", err)))?; [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this `impl` can be derived [INFO] [stdout] --> src/dng/mod.rs:61:1 [INFO] [stdout] | [INFO] [stdout] 61 | / impl Default for DngPhotometricConversion { [INFO] [stdout] 62 | | fn default() -> Self { [INFO] [stdout] 63 | | Self::Original [INFO] [stdout] 64 | | } [INFO] [stdout] 65 | | } [INFO] [stdout] | |_^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#derivable_impls [INFO] [stdout] help: replace the manual implementation with a derive attribute and mark the default variant [INFO] [stdout] | [INFO] [stdout] 56 + #[derive(Default)] [INFO] [stdout] 57 | pub enum DngPhotometricConversion { [INFO] [stdout] 58 ~ #[default] [INFO] [stdout] 59 ~ Original, [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: manual implementation of `Option::map` [INFO] [stdout] --> src/formats/tiff/ifd.rs:407:5 [INFO] [stdout] | [INFO] [stdout] 407 | / if let Some(entry) = self.get_entry(TiffCommonTag::NewSubFileType) { [INFO] [stdout] 408 | | Some(entry.force_u16(0)) [INFO] [stdout] 409 | | } else { [INFO] [stdout] 410 | | None [INFO] [stdout] 411 | | } [INFO] [stdout] | |_____^ help: try: `self.get_entry(TiffCommonTag::NewSubFileType).map(|entry| entry.force_u16(0))` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#manual_map [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: enclosing `Ok` and `?` operator are unneeded [INFO] [stdout] --> src/formats/tiff/ifd.rs:552:5 [INFO] [stdout] | [INFO] [stdout] 552 | Ok(tile_slices.into_iter().collect::>>()?) [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_question_mark [INFO] [stdout] = note: `#[warn(clippy::needless_question_mark)]` on by default [INFO] [stdout] help: remove the enclosing `Ok` and `?` operator [INFO] [stdout] | [INFO] [stdout] 552 - Ok(tile_slices.into_iter().collect::>>()?) [INFO] [stdout] 552 + tile_slices.into_iter().collect::>>() [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this `if` statement can be collapsed [INFO] [stdout] --> src/formats/tiff/reader.rs:174:7 [INFO] [stdout] | [INFO] [stdout] 174 | / if let Some(max) = max_chained { [INFO] [stdout] 175 | | if chain.len() > max { [INFO] [stdout] 176 | | break; [INFO] [stdout] 177 | | } [INFO] [stdout] 178 | | } [INFO] [stdout] | |_______^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#collapsible_if [INFO] [stdout] help: collapse nested if block [INFO] [stdout] | [INFO] [stdout] 174 ~ if let Some(max) = max_chained [INFO] [stdout] 175 ~ && chain.len() > max { [INFO] [stdout] 176 | break; [INFO] [stdout] 177 ~ } [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this `if` statement can be collapsed [INFO] [stdout] --> src/imgop/develop.rs:204:5 [INFO] [stdout] | [INFO] [stdout] 204 | / if self.steps.contains(&ProcessingStep::CropDefault) { [INFO] [stdout] 205 | | if let Some(mut crop) = rawimage.crop_area.or(rawimage.active_area) { [INFO] [stdout] 206 | | if self.steps.contains(&ProcessingStep::Demosaic) && self.steps.contains(&ProcessingStep::CropActiveArea) { [INFO] [stdout] ... | [INFO] [stdout] 225 | | } [INFO] [stdout] | |_____^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#collapsible_if [INFO] [stdout] help: collapse nested if block [INFO] [stdout] | [INFO] [stdout] 204 ~ if self.steps.contains(&ProcessingStep::CropDefault) [INFO] [stdout] 205 ~ && let Some(mut crop) = rawimage.crop_area.or(rawimage.active_area) { [INFO] [stdout] 206 | if self.steps.contains(&ProcessingStep::Demosaic) && self.steps.contains(&ProcessingStep::CropActiveArea) { [INFO] [stdout] ... [INFO] [stdout] 223 | } [INFO] [stdout] 224 ~ } [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: manual implementation of `.is_multiple_of()` [INFO] [stdout] --> src/formats/bmff/ftyp.rs:26:8 [INFO] [stdout] | [INFO] [stdout] 26 | if header.size % 4 != 0 { [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^ help: replace with: `!header.size.is_multiple_of(4)` [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: this `if` statement can be collapsed [INFO] [stdout] --> src/imgop/mod.rs:173:5 [INFO] [stdout] | [INFO] [stdout] 173 | / if let Some(crop) = ifd.get_entry(DngTag::DefaultCropOrigin) { [INFO] [stdout] 174 | | if let Some(dim) = ifd.get_entry(DngTag::DefaultCropSize) { [INFO] [stdout] 175 | | let p = Point::new(crop.force_usize(0), crop.force_usize(1)); [INFO] [stdout] 176 | | let d = Dim2::new(dim.force_usize(0), dim.force_usize(1)); [INFO] [stdout] ... | [INFO] [stdout] 179 | | } [INFO] [stdout] | |_____^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#collapsible_if [INFO] [stdout] help: collapse nested if block [INFO] [stdout] | [INFO] [stdout] 173 ~ if let Some(crop) = ifd.get_entry(DngTag::DefaultCropOrigin) [INFO] [stdout] 174 ~ && let Some(dim) = ifd.get_entry(DngTag::DefaultCropSize) { [INFO] [stdout] 175 | let p = Point::new(crop.force_usize(0), crop.force_usize(1)); [INFO] [stdout] 176 | let d = Dim2::new(dim.force_usize(0), dim.force_usize(1)); [INFO] [stdout] 177 | return Some(Self::new(p, d)); [INFO] [stdout] 178 ~ } [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this `if` statement can be collapsed [INFO] [stdout] --> src/lens.rs:205:5 [INFO] [stdout] | [INFO] [stdout] 205 | / if let Some(name) = self.lens_keyname.as_ref().filter(|s| !s.is_empty()) { [INFO] [stdout] 206 | | if let Some(db_entry) = LENSES_DB.iter().find(|entry| entry.identifiers.name == Some(name.into())) { [INFO] [stdout] 207 | | return Some(db_entry); [INFO] [stdout] 208 | | } [INFO] [stdout] 209 | | } [INFO] [stdout] | |_____^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#collapsible_if [INFO] [stdout] help: collapse nested if block [INFO] [stdout] | [INFO] [stdout] 205 ~ if let Some(name) = self.lens_keyname.as_ref().filter(|s| !s.is_empty()) [INFO] [stdout] 206 ~ && let Some(db_entry) = LENSES_DB.iter().find(|entry| entry.identifiers.name == Some(name.into())) { [INFO] [stdout] 207 | return Some(db_entry); [INFO] [stdout] 208 ~ } [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this `if` statement can be collapsed [INFO] [stdout] --> src/lens.rs:212:5 [INFO] [stdout] | [INFO] [stdout] 212 | / if let Some(nikon_id) = &self.nikon_id { [INFO] [stdout] 213 | | if let Some(db_entry) = LENSES_DB.iter().find(|entry| entry.identifiers.nikon_id == Some(nikon_id.clone())) { [INFO] [stdout] 214 | | return Some(db_entry); [INFO] [stdout] 215 | | } [INFO] [stdout] 216 | | } [INFO] [stdout] | |_____^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#collapsible_if [INFO] [stdout] help: collapse nested if block [INFO] [stdout] | [INFO] [stdout] 212 ~ if let Some(nikon_id) = &self.nikon_id [INFO] [stdout] 213 ~ && let Some(db_entry) = LENSES_DB.iter().find(|entry| entry.identifiers.nikon_id == Some(nikon_id.clone())) { [INFO] [stdout] 214 | return Some(db_entry); [INFO] [stdout] 215 ~ } [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this `if` statement can be collapsed [INFO] [stdout] --> src/lens.rs:219:5 [INFO] [stdout] | [INFO] [stdout] 219 | / if let Some(olympus_id) = &self.olympus_id { [INFO] [stdout] 220 | | if let Some(db_entry) = LENSES_DB.iter().find(|entry| entry.identifiers.olympus_id == Some(olympus_id.clone())) { [INFO] [stdout] 221 | | return Some(db_entry); [INFO] [stdout] 222 | | } [INFO] [stdout] 223 | | } [INFO] [stdout] | |_____^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#collapsible_if [INFO] [stdout] help: collapse nested if block [INFO] [stdout] | [INFO] [stdout] 219 ~ if let Some(olympus_id) = &self.olympus_id [INFO] [stdout] 220 ~ && let Some(db_entry) = LENSES_DB.iter().find(|entry| entry.identifiers.olympus_id == Some(olympus_id.clone())) { [INFO] [stdout] 221 | return Some(db_entry); [INFO] [stdout] 222 ~ } [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: consider using `sort_by_key` [INFO] [stdout] --> src/ljpeg92.rs:456:5 [INFO] [stdout] | [INFO] [stdout] 456 | dist.sort_by(|a, b| b.1.cmp(&a.1)); [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] 456 - dist.sort_by(|a, b| b.1.cmp(&a.1)); [INFO] [stdout] 456 + dist.sort_by_key(|b| std::cmp::Reverse(b.1)); [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: consider using `sort_by_key` [INFO] [stdout] --> src/ljpeg92.rs:748:9 [INFO] [stdout] | [INFO] [stdout] 748 | codes.sort_by(|a, b| a.1.cmp(&b.1)); [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] 748 - codes.sort_by(|a, b| a.1.cmp(&b.1)); [INFO] [stdout] 748 + codes.sort_by_key(|a| a.1); [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: struct `Pix2D` has a public `len` method, but no `is_empty` method [INFO] [stdout] --> src/pixarray.rs:93:3 [INFO] [stdout] | [INFO] [stdout] 93 | pub fn len(&self) -> usize { [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] [stdout] warning: this expression creates a reference which is immediately dereferenced by the compiler [INFO] [stdout] --> src/pixarray.rs:202:10 [INFO] [stdout] | [INFO] [stdout] 202 | crop(&self, area) [INFO] [stdout] | ^^^^^ help: change this to: `self` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_borrow [INFO] [stdout] = note: `#[warn(clippy::needless_borrow)]` on by default [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this `.into_iter()` call is equivalent to `.iter()` and will not consume the `slice` [INFO] [stdout] --> src/pumps.rs:35:12 [INFO] [stdout] | [INFO] [stdout] 35 | .into_iter() [INFO] [stdout] | ^^^^^^^^^ help: call directly: `iter` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#into_iter_on_ref [INFO] [stdout] = note: `#[warn(clippy::into_iter_on_ref)]` on by default [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this `.into_iter()` call is equivalent to `.iter()` and will not consume the `slice` [INFO] [stdout] --> src/pumps.rs:74:15 [INFO] [stdout] | [INFO] [stdout] 74 | chunk.into_iter().fold((0, 0), |(bits, bit_cnt), x| ((bits << 8) | *x as u32, bit_cnt + 8)) [INFO] [stdout] | ^^^^^^^^^ help: call directly: `iter` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#into_iter_on_ref [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this `.into_iter()` call is equivalent to `.iter()` and will not consume the `slice` [INFO] [stdout] --> src/pumps.rs:114:12 [INFO] [stdout] | [INFO] [stdout] 114 | .into_iter() [INFO] [stdout] | ^^^^^^^^^ help: call directly: `iter` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#into_iter_on_ref [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this `repeat().take()` can be written more concisely [INFO] [stdout] --> src/rawsource.rs:86:20 [INFO] [stdout] | [INFO] [stdout] 86 | buf.extend(repeat(0).take(16)); [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^ help: consider using `repeat_n()` instead: `std::iter::repeat_n(0, 16)` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#manual_repeat_n [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this `repeat().take()` can be written more concisely [INFO] [stdout] --> src/rawsource.rs:108:18 [INFO] [stdout] | [INFO] [stdout] 108 | buf.extend(repeat(0).take(16)); [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^ help: consider using `repeat_n()` instead: `std::iter::repeat_n(0, 16)` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#manual_repeat_n [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: manual implementation of `Option::map` [INFO] [stdout] --> src/formats/tiff/ifd.rs:407:5 [INFO] [stdout] | [INFO] [stdout] 407 | / if let Some(entry) = self.get_entry(TiffCommonTag::NewSubFileType) { [INFO] [stdout] 408 | | Some(entry.force_u16(0)) [INFO] [stdout] 409 | | } else { [INFO] [stdout] 410 | | None [INFO] [stdout] 411 | | } [INFO] [stdout] | |_____^ help: try: `self.get_entry(TiffCommonTag::NewSubFileType).map(|entry| entry.force_u16(0))` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#manual_map [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: enclosing `Ok` and `?` operator are unneeded [INFO] [stdout] --> src/formats/tiff/ifd.rs:552:5 [INFO] [stdout] | [INFO] [stdout] 552 | Ok(tile_slices.into_iter().collect::>>()?) [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_question_mark [INFO] [stdout] = note: `#[warn(clippy::needless_question_mark)]` on by default [INFO] [stdout] help: remove the enclosing `Ok` and `?` operator [INFO] [stdout] | [INFO] [stdout] 552 - Ok(tile_slices.into_iter().collect::>>()?) [INFO] [stdout] 552 + tile_slices.into_iter().collect::>>() [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this `if` statement can be collapsed [INFO] [stdout] --> src/formats/tiff/reader.rs:174:7 [INFO] [stdout] | [INFO] [stdout] 174 | / if let Some(max) = max_chained { [INFO] [stdout] 175 | | if chain.len() > max { [INFO] [stdout] 176 | | break; [INFO] [stdout] 177 | | } [INFO] [stdout] 178 | | } [INFO] [stdout] | |_______^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#collapsible_if [INFO] [stdout] help: collapse nested if block [INFO] [stdout] | [INFO] [stdout] 174 ~ if let Some(max) = max_chained [INFO] [stdout] 175 ~ && chain.len() > max { [INFO] [stdout] 176 | break; [INFO] [stdout] 177 ~ } [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: manual implementation of `.is_multiple_of()` [INFO] [stdout] --> src/tiles.rs:56:5 [INFO] [stdout] | [INFO] [stdout] 56 | self.width % self.tw > 0 [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^ help: replace with: `!self.width.is_multiple_of(self.tw)` [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: this `repeat().take()` can be written more concisely [INFO] [stdout] --> src/tiles.rs:87:24 [INFO] [stdout] | [INFO] [stdout] 87 | buf.extend(iter::repeat(last_pix).take((self.tw - (self.width % self.tw)) * self.cpp)); [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: consider using `repeat_n()` instead: `std::iter::repeat_n(last_pix, (self.tw - (self.width % self.tw)) * self.cpp)` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#manual_repeat_n [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: unneeded `return` statement [INFO] [stdout] --> src/tiles.rs:204:7 [INFO] [stdout] | [INFO] [stdout] 204 | return None; [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] 204 - return None; [INFO] [stdout] 204 + None [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: use of `offset` with a `usize` casted to an `isize` [INFO] [stdout] --> src/tiles.rs:286:29 [INFO] [stdout] | [INFO] [stdout] 286 | let line_ptr = unsafe { (self.tile.first_line as *mut T).offset((self.current_line * next_line_distance) as isize) }; [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#ptr_offset_with_cast [INFO] [stdout] = note: `#[warn(clippy::ptr_offset_with_cast)]` on by default [INFO] [stdout] help: use `add` instead [INFO] [stdout] | [INFO] [stdout] 286 - let line_ptr = unsafe { (self.tile.first_line as *mut T).offset((self.current_line * next_line_distance) as isize) }; [INFO] [stdout] 286 + let line_ptr = unsafe { (self.tile.first_line as *mut T).add((self.current_line * next_line_distance)) }; [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: `to_string` applied to a type that implements `Display` in `error!` args [INFO] [stdout] --> src/lib.rs:154:37 [INFO] [stdout] | [INFO] [stdout] 154 | log::error!("I/O error: {}", err.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] = note: `#[warn(clippy::to_string_in_format_args)]` on by default [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this `if` statement can be collapsed [INFO] [stdout] --> src/imgop/develop.rs:204:5 [INFO] [stdout] | [INFO] [stdout] 204 | / if self.steps.contains(&ProcessingStep::CropDefault) { [INFO] [stdout] 205 | | if let Some(mut crop) = rawimage.crop_area.or(rawimage.active_area) { [INFO] [stdout] 206 | | if self.steps.contains(&ProcessingStep::Demosaic) && self.steps.contains(&ProcessingStep::CropActiveArea) { [INFO] [stdout] ... | [INFO] [stdout] 225 | | } [INFO] [stdout] | |_____^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#collapsible_if [INFO] [stdout] help: collapse nested if block [INFO] [stdout] | [INFO] [stdout] 204 ~ if self.steps.contains(&ProcessingStep::CropDefault) [INFO] [stdout] 205 ~ && let Some(mut crop) = rawimage.crop_area.or(rawimage.active_area) { [INFO] [stdout] 206 | if self.steps.contains(&ProcessingStep::Demosaic) && self.steps.contains(&ProcessingStep::CropActiveArea) { [INFO] [stdout] ... [INFO] [stdout] 223 | } [INFO] [stdout] 224 ~ } [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this `if` statement can be collapsed [INFO] [stdout] --> src/imgop/mod.rs:173:5 [INFO] [stdout] | [INFO] [stdout] 173 | / if let Some(crop) = ifd.get_entry(DngTag::DefaultCropOrigin) { [INFO] [stdout] 174 | | if let Some(dim) = ifd.get_entry(DngTag::DefaultCropSize) { [INFO] [stdout] 175 | | let p = Point::new(crop.force_usize(0), crop.force_usize(1)); [INFO] [stdout] 176 | | let d = Dim2::new(dim.force_usize(0), dim.force_usize(1)); [INFO] [stdout] ... | [INFO] [stdout] 179 | | } [INFO] [stdout] | |_____^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#collapsible_if [INFO] [stdout] help: collapse nested if block [INFO] [stdout] | [INFO] [stdout] 173 ~ if let Some(crop) = ifd.get_entry(DngTag::DefaultCropOrigin) [INFO] [stdout] 174 ~ && let Some(dim) = ifd.get_entry(DngTag::DefaultCropSize) { [INFO] [stdout] 175 | let p = Point::new(crop.force_usize(0), crop.force_usize(1)); [INFO] [stdout] 176 | let d = Dim2::new(dim.force_usize(0), dim.force_usize(1)); [INFO] [stdout] 177 | return Some(Self::new(p, d)); [INFO] [stdout] 178 ~ } [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this `if` statement can be collapsed [INFO] [stdout] --> src/lens.rs:205:5 [INFO] [stdout] | [INFO] [stdout] 205 | / if let Some(name) = self.lens_keyname.as_ref().filter(|s| !s.is_empty()) { [INFO] [stdout] 206 | | if let Some(db_entry) = LENSES_DB.iter().find(|entry| entry.identifiers.name == Some(name.into())) { [INFO] [stdout] 207 | | return Some(db_entry); [INFO] [stdout] 208 | | } [INFO] [stdout] 209 | | } [INFO] [stdout] | |_____^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#collapsible_if [INFO] [stdout] help: collapse nested if block [INFO] [stdout] | [INFO] [stdout] 205 ~ if let Some(name) = self.lens_keyname.as_ref().filter(|s| !s.is_empty()) [INFO] [stdout] 206 ~ && let Some(db_entry) = LENSES_DB.iter().find(|entry| entry.identifiers.name == Some(name.into())) { [INFO] [stdout] 207 | return Some(db_entry); [INFO] [stdout] 208 ~ } [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this `if` statement can be collapsed [INFO] [stdout] --> src/lens.rs:212:5 [INFO] [stdout] | [INFO] [stdout] 212 | / if let Some(nikon_id) = &self.nikon_id { [INFO] [stdout] 213 | | if let Some(db_entry) = LENSES_DB.iter().find(|entry| entry.identifiers.nikon_id == Some(nikon_id.clone())) { [INFO] [stdout] 214 | | return Some(db_entry); [INFO] [stdout] 215 | | } [INFO] [stdout] 216 | | } [INFO] [stdout] | |_____^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#collapsible_if [INFO] [stdout] help: collapse nested if block [INFO] [stdout] | [INFO] [stdout] 212 ~ if let Some(nikon_id) = &self.nikon_id [INFO] [stdout] 213 ~ && let Some(db_entry) = LENSES_DB.iter().find(|entry| entry.identifiers.nikon_id == Some(nikon_id.clone())) { [INFO] [stdout] 214 | return Some(db_entry); [INFO] [stdout] 215 ~ } [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this `if` statement can be collapsed [INFO] [stdout] --> src/lens.rs:219:5 [INFO] [stdout] | [INFO] [stdout] 219 | / if let Some(olympus_id) = &self.olympus_id { [INFO] [stdout] 220 | | if let Some(db_entry) = LENSES_DB.iter().find(|entry| entry.identifiers.olympus_id == Some(olympus_id.clone())) { [INFO] [stdout] 221 | | return Some(db_entry); [INFO] [stdout] 222 | | } [INFO] [stdout] 223 | | } [INFO] [stdout] | |_____^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#collapsible_if [INFO] [stdout] help: collapse nested if block [INFO] [stdout] | [INFO] [stdout] 219 ~ if let Some(olympus_id) = &self.olympus_id [INFO] [stdout] 220 ~ && let Some(db_entry) = LENSES_DB.iter().find(|entry| entry.identifiers.olympus_id == Some(olympus_id.clone())) { [INFO] [stdout] 221 | return Some(db_entry); [INFO] [stdout] 222 ~ } [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: consider using `sort_by_key` [INFO] [stdout] --> src/ljpeg92.rs:456:5 [INFO] [stdout] | [INFO] [stdout] 456 | dist.sort_by(|a, b| b.1.cmp(&a.1)); [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] 456 - dist.sort_by(|a, b| b.1.cmp(&a.1)); [INFO] [stdout] 456 + dist.sort_by_key(|b| std::cmp::Reverse(b.1)); [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: consider using `sort_by_key` [INFO] [stdout] --> src/ljpeg92.rs:748:9 [INFO] [stdout] | [INFO] [stdout] 748 | codes.sort_by(|a, b| a.1.cmp(&b.1)); [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] 748 - codes.sort_by(|a, b| a.1.cmp(&b.1)); [INFO] [stdout] 748 + codes.sort_by_key(|a| a.1); [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: struct `Pix2D` has a public `len` method, but no `is_empty` method [INFO] [stdout] --> src/pixarray.rs:93:3 [INFO] [stdout] | [INFO] [stdout] 93 | pub fn len(&self) -> usize { [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] [stdout] warning: this expression creates a reference which is immediately dereferenced by the compiler [INFO] [stdout] --> src/pixarray.rs:202:10 [INFO] [stdout] | [INFO] [stdout] 202 | crop(&self, area) [INFO] [stdout] | ^^^^^ help: change this to: `self` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_borrow [INFO] [stdout] = note: `#[warn(clippy::needless_borrow)]` on by default [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this `.into_iter()` call is equivalent to `.iter()` and will not consume the `slice` [INFO] [stdout] --> src/pumps.rs:35:12 [INFO] [stdout] | [INFO] [stdout] 35 | .into_iter() [INFO] [stdout] | ^^^^^^^^^ help: call directly: `iter` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#into_iter_on_ref [INFO] [stdout] = note: `#[warn(clippy::into_iter_on_ref)]` on by default [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this `.into_iter()` call is equivalent to `.iter()` and will not consume the `slice` [INFO] [stdout] --> src/pumps.rs:74:15 [INFO] [stdout] | [INFO] [stdout] 74 | chunk.into_iter().fold((0, 0), |(bits, bit_cnt), x| ((bits << 8) | *x as u32, bit_cnt + 8)) [INFO] [stdout] | ^^^^^^^^^ help: call directly: `iter` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#into_iter_on_ref [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this `.into_iter()` call is equivalent to `.iter()` and will not consume the `slice` [INFO] [stdout] --> src/pumps.rs:114:12 [INFO] [stdout] | [INFO] [stdout] 114 | .into_iter() [INFO] [stdout] | ^^^^^^^^^ help: call directly: `iter` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#into_iter_on_ref [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this `repeat().take()` can be written more concisely [INFO] [stdout] --> src/rawsource.rs:86:20 [INFO] [stdout] | [INFO] [stdout] 86 | buf.extend(repeat(0).take(16)); [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^ help: consider using `repeat_n()` instead: `std::iter::repeat_n(0, 16)` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#manual_repeat_n [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this `repeat().take()` can be written more concisely [INFO] [stdout] --> src/rawsource.rs:108:18 [INFO] [stdout] | [INFO] [stdout] 108 | buf.extend(repeat(0).take(16)); [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^ help: consider using `repeat_n()` instead: `std::iter::repeat_n(0, 16)` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#manual_repeat_n [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: manual implementation of `.is_multiple_of()` [INFO] [stdout] --> src/tiles.rs:56:5 [INFO] [stdout] | [INFO] [stdout] 56 | self.width % self.tw > 0 [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^ help: replace with: `!self.width.is_multiple_of(self.tw)` [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: this `repeat().take()` can be written more concisely [INFO] [stdout] --> src/tiles.rs:87:24 [INFO] [stdout] | [INFO] [stdout] 87 | buf.extend(iter::repeat(last_pix).take((self.tw - (self.width % self.tw)) * self.cpp)); [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: consider using `repeat_n()` instead: `std::iter::repeat_n(last_pix, (self.tw - (self.width % self.tw)) * self.cpp)` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#manual_repeat_n [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: unneeded `return` statement [INFO] [stdout] --> src/tiles.rs:204:7 [INFO] [stdout] | [INFO] [stdout] 204 | return None; [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] 204 - return None; [INFO] [stdout] 204 + None [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: use of `offset` with a `usize` casted to an `isize` [INFO] [stdout] --> src/tiles.rs:286:29 [INFO] [stdout] | [INFO] [stdout] 286 | let line_ptr = unsafe { (self.tile.first_line as *mut T).offset((self.current_line * next_line_distance) as isize) }; [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#ptr_offset_with_cast [INFO] [stdout] = note: `#[warn(clippy::ptr_offset_with_cast)]` on by default [INFO] [stdout] help: use `add` instead [INFO] [stdout] | [INFO] [stdout] 286 - let line_ptr = unsafe { (self.tile.first_line as *mut T).offset((self.current_line * next_line_distance) as isize) }; [INFO] [stdout] 286 + let line_ptr = unsafe { (self.tile.first_line as *mut T).add((self.current_line * next_line_distance)) }; [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: `to_string` applied to a type that implements `Display` in `error!` args [INFO] [stdout] --> src/lib.rs:154:37 [INFO] [stdout] | [INFO] [stdout] 154 | log::error!("I/O error: {}", err.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] = note: `#[warn(clippy::to_string_in_format_args)]` on by default [INFO] [stdout] [INFO] [stdout] [INFO] [stderr] Finished `dev` profile [unoptimized + debuginfo] target(s) in 54.39s [INFO] running `Command { std: "docker" "inspect" "a96da0c6568f4d28a83103723a6de3075d64a56b1284cd77ab66e7855d4fa5d1", kill_on_drop: false }` [INFO] running `Command { std: "docker" "rm" "-f" "a96da0c6568f4d28a83103723a6de3075d64a56b1284cd77ab66e7855d4fa5d1", kill_on_drop: false }` [INFO] [stdout] a96da0c6568f4d28a83103723a6de3075d64a56b1284cd77ab66e7855d4fa5d1