[INFO] fetching crate ultilinter 0.4.1... [INFO] linting ultilinter-0.4.1 against nightly for clippy-nonminimal_bool-denied [INFO] extracting crate ultilinter 0.4.1 into /workspace/builds/worker-3-tc1/source [INFO] started tweaking crates.io crate ultilinter 0.4.1 [INFO] finished tweaking crates.io crate ultilinter 0.4.1 [INFO] tweaked toml for crates.io crate ultilinter 0.4.1 written to /workspace/builds/worker-3-tc1/source/Cargo.toml [INFO] validating manifest of crates.io crate ultilinter 0.4.1 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 ultilinter 0.4.1 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] running `Command { std: "docker" "create" "-v" "/var/lib/crater-agent-workspace/builds/worker-3-tc1/target:/opt/rustwide/target:rw,Z" "-v" "/var/lib/crater-agent-workspace/builds/worker-3-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] fcb0ea6aba8c03b40b9593fe1e6baea493f15393d5e1165bce7b67b85e2d3fa9 [INFO] running `Command { std: "docker" "start" "-a" "fcb0ea6aba8c03b40b9593fe1e6baea493f15393d5e1165bce7b67b85e2d3fa9", kill_on_drop: false }` [INFO] running `Command { std: "docker" "inspect" "fcb0ea6aba8c03b40b9593fe1e6baea493f15393d5e1165bce7b67b85e2d3fa9", kill_on_drop: false }` [INFO] running `Command { std: "docker" "rm" "-f" "fcb0ea6aba8c03b40b9593fe1e6baea493f15393d5e1165bce7b67b85e2d3fa9", kill_on_drop: false }` [INFO] [stdout] fcb0ea6aba8c03b40b9593fe1e6baea493f15393d5e1165bce7b67b85e2d3fa9 [INFO] running `Command { std: "docker" "create" "-v" "/var/lib/crater-agent-workspace/builds/worker-3-tc1/target:/opt/rustwide/target:rw,Z" "-v" "/var/lib/crater-agent-workspace/builds/worker-3-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] 68398747867b0f39ec97fbb4da7e42e32d98675125a906da322b81b1430b81e3 [INFO] running `Command { std: "docker" "start" "-a" "68398747867b0f39ec97fbb4da7e42e32d98675125a906da322b81b1430b81e3", kill_on_drop: false }` [INFO] [stderr] Checking ultilinter v0.4.1 (/opt/rustwide/workdir) [INFO] [stdout] warning: you should consider adding a `Default` implementation for `LintConfig` [INFO] [stdout] --> src/core/config.rs:7:5 [INFO] [stdout] | [INFO] [stdout] 7 | / pub fn new() -> Self { [INFO] [stdout] 8 | | Self { [INFO] [stdout] 9 | | disabled_rules: Vec::new(), [INFO] [stdout] 10 | | } [INFO] [stdout] 11 | | } [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 LintConfig { [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 `Linter` [INFO] [stdout] --> src/core/linter.rs:10:5 [INFO] [stdout] | [INFO] [stdout] 10 | / pub fn new() -> Self { [INFO] [stdout] 11 | | Self { rules: Vec::new() } [INFO] [stdout] 12 | | } [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] 8 + impl Default for Linter { [INFO] [stdout] 9 + fn default() -> Self { [INFO] [stdout] 10 + Self::new() [INFO] [stdout] 11 + } [INFO] [stdout] 12 + } [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this `if` statement can be collapsed [INFO] [stdout] --> src/linters/cpp/mod.rs:241:13 [INFO] [stdout] | [INFO] [stdout] 241 | / if line.contains("(") && line.contains(")") && line.contains(")") && line.contains(")") { [INFO] [stdout] 242 | | if line.contains(")") && line.contains(");") && line.contains("(") { [INFO] [stdout] 243 | | report.push(LintError { [INFO] [stdout] 244 | | file: file.map(|p| p.to_path_buf()), [INFO] [stdout] ... | [INFO] [stdout] 254 | | } [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] 241 ~ if line.contains("(") && line.contains(")") && line.contains(")") && line.contains(")") [INFO] [stdout] 242 ~ && line.contains(")") && line.contains(");") && line.contains("(") { [INFO] [stdout] 243 | report.push(LintError { [INFO] [stdout] ... [INFO] [stdout] 252 | }); [INFO] [stdout] 253 ~ } [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this `if` statement can be collapsed [INFO] [stdout] --> src/linters/css/rules/info.rs:145:13 [INFO] [stdout] | [INFO] [stdout] 145 | / if let (Some(open), Some(close)) = (line.find('{'), line.rfind('}')) { [INFO] [stdout] 146 | | if open < close { [INFO] [stdout] 147 | | let indent: String = [INFO] [stdout] 148 | | line.chars().take_while(|c| c.is_whitespace()).collect(); [INFO] [stdout] ... | [INFO] [stdout] 175 | | } [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] 145 ~ if let (Some(open), Some(close)) = (line.find('{'), line.rfind('}')) [INFO] [stdout] 146 ~ && open < close { [INFO] [stdout] 147 | let indent: String = [INFO] [stdout] ... [INFO] [stdout] 173 | } [INFO] [stdout] 174 ~ } [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this `if` statement can be collapsed [INFO] [stdout] --> src/linters/dart/mod.rs:276:13 [INFO] [stdout] | [INFO] [stdout] 276 | / if line.contains("(") && line.contains(")") && line.contains("{") && !line.contains("=>") { [INFO] [stdout] 277 | | if !line.contains("Future") && !line.contains("void") && !line.contains("int") { [INFO] [stdout] 278 | | report.push(LintError { [INFO] [stdout] 279 | | file: file.map(|p| p.to_path_buf()), [INFO] [stdout] ... | [INFO] [stdout] 289 | | } [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] 276 ~ if line.contains("(") && line.contains(")") && line.contains("{") && !line.contains("=>") [INFO] [stdout] 277 ~ && !line.contains("Future") && !line.contains("void") && !line.contains("int") { [INFO] [stdout] 278 | report.push(LintError { [INFO] [stdout] ... [INFO] [stdout] 287 | }); [INFO] [stdout] 288 ~ } [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this manual char comparison can be written more succinctly [INFO] [stdout] --> src/linters/html/mod.rs:105:46 [INFO] [stdout] | [INFO] [stdout] 105 | for (idx, _) in source.match_indices(|c| c == '<') { [INFO] [stdout] | ^^^^^^^^^^^^ help: consider using a `char`: `'<'` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#manual_pattern_char_comparison [INFO] [stdout] = note: `#[warn(clippy::manual_pattern_char_comparison)]` on by default [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: you seem to use `.enumerate()` and immediately discard the index [INFO] [stdout] --> src/linters/html/mod.rs:176:40 [INFO] [stdout] | [INFO] [stdout] 176 | for (_, line) in source.lines().enumerate() { [INFO] [stdout] | ^^^^^^^^^^^^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#unused_enumerate_index [INFO] [stdout] = note: `#[warn(clippy::unused_enumerate_index)]` on by default [INFO] [stdout] help: remove the `.enumerate()` call [INFO] [stdout] | [INFO] [stdout] 176 - for (_, line) in source.lines().enumerate() { [INFO] [stdout] 176 + for line in source.lines() { [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: you should consider adding a `Default` implementation for `LintConfig` [INFO] [stdout] --> src/core/config.rs:7:5 [INFO] [stdout] | [INFO] [stdout] 7 | / pub fn new() -> Self { [INFO] [stdout] 8 | | Self { [INFO] [stdout] 9 | | disabled_rules: Vec::new(), [INFO] [stdout] 10 | | } [INFO] [stdout] 11 | | } [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 LintConfig { [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 `Linter` [INFO] [stdout] --> src/core/linter.rs:10:5 [INFO] [stdout] | [INFO] [stdout] 10 | / pub fn new() -> Self { [INFO] [stdout] 11 | | Self { rules: Vec::new() } [INFO] [stdout] 12 | | } [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] 8 + impl Default for Linter { [INFO] [stdout] 9 + fn default() -> Self { [INFO] [stdout] 10 + Self::new() [INFO] [stdout] 11 + } [INFO] [stdout] 12 + } [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this if-then-else expression assigns a bool literal [INFO] [stdout] --> src/linters/md/rules/code.rs:203:17 [INFO] [stdout] | [INFO] [stdout] 203 | / if !in_code_block { [INFO] [stdout] 204 | | in_code_block = true; [INFO] [stdout] 205 | | } else { [INFO] [stdout] 206 | | in_code_block = false; [INFO] [stdout] 207 | | } [INFO] [stdout] | |_________________^ help: you can reduce it to: `in_code_block = !in_code_block;` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_bool_assign [INFO] [stdout] = note: `#[warn(clippy::needless_bool_assign)]` on by default [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this `if` statement can be collapsed [INFO] [stdout] --> src/linters/md/rules/header.rs:96:13 [INFO] [stdout] | [INFO] [stdout] 96 | / if let Some(first) = line.chars().next() { [INFO] [stdout] 97 | | if first == '#' { [INFO] [stdout] 98 | | let level = line.chars().take_while(|c| *c == '#').count(); [INFO] [stdout] 99 | | if last_level != 0 && (level as i32 - last_level as i32).abs() > 1 { [INFO] [stdout] ... | [INFO] [stdout] 113 | | } [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] 96 ~ if let Some(first) = line.chars().next() [INFO] [stdout] 97 ~ && first == '#' { [INFO] [stdout] 98 | let level = line.chars().take_while(|c| *c == '#').count(); [INFO] [stdout] ... [INFO] [stdout] 111 | last_level = level; [INFO] [stdout] 112 ~ } [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this `if` statement can be collapsed [INFO] [stdout] --> src/linters/cpp/mod.rs:241:13 [INFO] [stdout] | [INFO] [stdout] 241 | / if line.contains("(") && line.contains(")") && line.contains(")") && line.contains(")") { [INFO] [stdout] 242 | | if line.contains(")") && line.contains(");") && line.contains("(") { [INFO] [stdout] 243 | | report.push(LintError { [INFO] [stdout] 244 | | file: file.map(|p| p.to_path_buf()), [INFO] [stdout] ... | [INFO] [stdout] 254 | | } [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] 241 ~ if line.contains("(") && line.contains(")") && line.contains(")") && line.contains(")") [INFO] [stdout] 242 ~ && line.contains(")") && line.contains(");") && line.contains("(") { [INFO] [stdout] 243 | report.push(LintError { [INFO] [stdout] ... [INFO] [stdout] 252 | }); [INFO] [stdout] 253 ~ } [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this `if` statement can be collapsed [INFO] [stdout] --> src/linters/md/rules/image.rs:270:21 [INFO] [stdout] | [INFO] [stdout] 270 | / if !path_str.starts_with("http://") && !path_str.starts_with("https://") { [INFO] [stdout] 271 | | if let Some(base_path) = file { [INFO] [stdout] 272 | | let parent = base_path.parent().unwrap_or_else(|| Path::new(".")); [INFO] [stdout] 273 | | let image_path = parent.join(path_str); [INFO] [stdout] ... | [INFO] [stdout] 287 | | } [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] 270 ~ if !path_str.starts_with("http://") && !path_str.starts_with("https://") [INFO] [stdout] 271 ~ && let Some(base_path) = file { [INFO] [stdout] 272 | let parent = base_path.parent().unwrap_or_else(|| Path::new(".")); [INFO] [stdout] ... [INFO] [stdout] 285 | } [INFO] [stdout] 286 ~ } [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this `if` statement can be collapsed [INFO] [stdout] --> src/linters/md/rules/image.rs:358:13 [INFO] [stdout] | [INFO] [stdout] 358 | / if let Some(start) = line.find("![") { [INFO] [stdout] 359 | | if let Some(end) = line[start..].find(']').map(|v| v + start) { [INFO] [stdout] 360 | | let alt_text = line[start+2..end].trim().to_string(); [INFO] [stdout] 361 | | if !alt_text.is_empty() { [INFO] [stdout] ... | [INFO] [stdout] 378 | | } [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] 358 ~ if let Some(start) = line.find("![") [INFO] [stdout] 359 ~ && let Some(end) = line[start..].find(']').map(|v| v + start) { [INFO] [stdout] 360 | let alt_text = line[start+2..end].trim().to_string(); [INFO] [stdout] ... [INFO] [stdout] 376 | } [INFO] [stdout] 377 ~ } [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this `if` statement can be collapsed [INFO] [stdout] --> src/linters/md/rules/list.rs:44:13 [INFO] [stdout] | [INFO] [stdout] 44 | / if is_list { [INFO] [stdout] 45 | | if !prev_was_list && i > 0 && !source.lines().nth(i-1).unwrap_or("").trim().is_empty() { [INFO] [stdout] 46 | | report.push(LintError { [INFO] [stdout] 47 | | file: file.map(|p| p.to_path_buf()), [INFO] [stdout] ... | [INFO] [stdout] 63 | | } [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] 44 ~ if is_list [INFO] [stdout] 45 ~ && !prev_was_list && i > 0 && !source.lines().nth(i-1).unwrap_or("").trim().is_empty() { [INFO] [stdout] 46 | report.push(LintError { [INFO] [stdout] ... [INFO] [stdout] 61 | }); [INFO] [stdout] 62 ~ } [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this `if` statement can be collapsed [INFO] [stdout] --> src/linters/md/rules/list.rs:93:17 [INFO] [stdout] | [INFO] [stdout] 93 | / if let Some(prev) = current_marker { [INFO] [stdout] 94 | | if prev != marker { [INFO] [stdout] 95 | | report.push(LintError { [INFO] [stdout] 96 | | file: file.map(|p| p.to_path_buf()), [INFO] [stdout] ... | [INFO] [stdout] 106 | | } [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] 93 ~ if let Some(prev) = current_marker [INFO] [stdout] 94 ~ && prev != marker { [INFO] [stdout] 95 | report.push(LintError { [INFO] [stdout] ... [INFO] [stdout] 104 | }); [INFO] [stdout] 105 ~ } [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this `if` statement can be collapsed [INFO] [stdout] --> src/linters/md/rules/list.rs:257:13 [INFO] [stdout] | [INFO] [stdout] 257 | / if let Some(pos) = trimmed.find('.') { [INFO] [stdout] 258 | | if let Ok(num) = trimmed[..pos].parse::() { [INFO] [stdout] 259 | | if num != expected_number { [INFO] [stdout] 260 | | report.push(LintError { [INFO] [stdout] ... | [INFO] [stdout] 273 | | } [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] 257 ~ if let Some(pos) = trimmed.find('.') [INFO] [stdout] 258 ~ && let Ok(num) = trimmed[..pos].parse::() { [INFO] [stdout] 259 | if num != expected_number { [INFO] [stdout] ... [INFO] [stdout] 271 | expected_number = num + 1; [INFO] [stdout] 272 ~ } [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this `if` statement can be collapsed [INFO] [stdout] --> src/linters/md/rules/table.rs:144:13 [INFO] [stdout] | [INFO] [stdout] 144 | / if trimmed.contains('|') { [INFO] [stdout] 145 | | if !trimmed.starts_with('|') || !trimmed.ends_with('|') { [INFO] [stdout] 146 | | report.push(LintError { [INFO] [stdout] 147 | | file: file.map(|p| p.to_path_buf()), [INFO] [stdout] ... | [INFO] [stdout] 157 | | } [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] 144 ~ if trimmed.contains('|') [INFO] [stdout] 145 ~ && (!trimmed.starts_with('|') || !trimmed.ends_with('|')) { [INFO] [stdout] 146 | report.push(LintError { [INFO] [stdout] ... [INFO] [stdout] 155 | }); [INFO] [stdout] 156 ~ } [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: length comparison to zero [INFO] [stdout] --> src/linters/md/rules/table.rs:266:20 [INFO] [stdout] | [INFO] [stdout] 266 | if cells.len() == 0 { [INFO] [stdout] | ^^^^^^^^^^^^^^^^ help: using `is_empty` is clearer and more explicit: `cells.is_empty()` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#len_zero [INFO] [stdout] = note: `#[warn(clippy::len_zero)]` on by default [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this `if` statement can be collapsed [INFO] [stdout] --> src/linters/css/rules/info.rs:145:13 [INFO] [stdout] | [INFO] [stdout] 145 | / if let (Some(open), Some(close)) = (line.find('{'), line.rfind('}')) { [INFO] [stdout] 146 | | if open < close { [INFO] [stdout] 147 | | let indent: String = [INFO] [stdout] 148 | | line.chars().take_while(|c| c.is_whitespace()).collect(); [INFO] [stdout] ... | [INFO] [stdout] 175 | | } [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] 145 ~ if let (Some(open), Some(close)) = (line.find('{'), line.rfind('}')) [INFO] [stdout] 146 ~ && open < close { [INFO] [stdout] 147 | let indent: String = [INFO] [stdout] ... [INFO] [stdout] 173 | } [INFO] [stdout] 174 ~ } [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this boolean expression can be simplified [INFO] [stdout] --> src/linters/php/mod.rs:238:57 [INFO] [stdout] | [INFO] [stdout] 238 | if line.trim_start().starts_with("use ") && !source.matches(line.trim()).skip(1).next().is_some() { [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: try: `source.matches(line.trim()).skip(1).next().is_none()` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#nonminimal_bool [INFO] [stdout] = note: `#[warn(clippy::nonminimal_bool)]` on by default [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: called `skip(..).next()` on an iterator [INFO] [stdout] --> src/linters/php/mod.rs:238:85 [INFO] [stdout] | [INFO] [stdout] 238 | if line.trim_start().starts_with("use ") && !source.matches(line.trim()).skip(1).next().is_some() { [INFO] [stdout] | ^^^^^^^^^^^^^^^ help: use `nth` instead: `.nth(1)` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#iter_skip_next [INFO] [stdout] = note: `#[warn(clippy::iter_skip_next)]` on by default [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this `if` statement can be collapsed [INFO] [stdout] --> src/linters/dart/mod.rs:276:13 [INFO] [stdout] | [INFO] [stdout] 276 | / if line.contains("(") && line.contains(")") && line.contains("{") && !line.contains("=>") { [INFO] [stdout] 277 | | if !line.contains("Future") && !line.contains("void") && !line.contains("int") { [INFO] [stdout] 278 | | report.push(LintError { [INFO] [stdout] 279 | | file: file.map(|p| p.to_path_buf()), [INFO] [stdout] ... | [INFO] [stdout] 289 | | } [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] 276 ~ if line.contains("(") && line.contains(")") && line.contains("{") && !line.contains("=>") [INFO] [stdout] 277 ~ && !line.contains("Future") && !line.contains("void") && !line.contains("int") { [INFO] [stdout] 278 | report.push(LintError { [INFO] [stdout] ... [INFO] [stdout] 287 | }); [INFO] [stdout] 288 ~ } [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this manual char comparison can be written more succinctly [INFO] [stdout] --> src/linters/html/mod.rs:105:46 [INFO] [stdout] | [INFO] [stdout] 105 | for (idx, _) in source.match_indices(|c| c == '<') { [INFO] [stdout] | ^^^^^^^^^^^^ help: consider using a `char`: `'<'` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#manual_pattern_char_comparison [INFO] [stdout] = note: `#[warn(clippy::manual_pattern_char_comparison)]` on by default [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: you seem to use `.enumerate()` and immediately discard the index [INFO] [stdout] --> src/linters/html/mod.rs:176:40 [INFO] [stdout] | [INFO] [stdout] 176 | for (_, line) in source.lines().enumerate() { [INFO] [stdout] | ^^^^^^^^^^^^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#unused_enumerate_index [INFO] [stdout] = note: `#[warn(clippy::unused_enumerate_index)]` on by default [INFO] [stdout] help: remove the `.enumerate()` call [INFO] [stdout] | [INFO] [stdout] 176 - for (_, line) in source.lines().enumerate() { [INFO] [stdout] 176 + for line in source.lines() { [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this if-then-else expression assigns a bool literal [INFO] [stdout] --> src/linters/md/rules/code.rs:203:17 [INFO] [stdout] | [INFO] [stdout] 203 | / if !in_code_block { [INFO] [stdout] 204 | | in_code_block = true; [INFO] [stdout] 205 | | } else { [INFO] [stdout] 206 | | in_code_block = false; [INFO] [stdout] 207 | | } [INFO] [stdout] | |_________________^ help: you can reduce it to: `in_code_block = !in_code_block;` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_bool_assign [INFO] [stdout] = note: `#[warn(clippy::needless_bool_assign)]` on by default [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this `if` statement can be collapsed [INFO] [stdout] --> src/linters/md/rules/header.rs:96:13 [INFO] [stdout] | [INFO] [stdout] 96 | / if let Some(first) = line.chars().next() { [INFO] [stdout] 97 | | if first == '#' { [INFO] [stdout] 98 | | let level = line.chars().take_while(|c| *c == '#').count(); [INFO] [stdout] 99 | | if last_level != 0 && (level as i32 - last_level as i32).abs() > 1 { [INFO] [stdout] ... | [INFO] [stdout] 113 | | } [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] 96 ~ if let Some(first) = line.chars().next() [INFO] [stdout] 97 ~ && first == '#' { [INFO] [stdout] 98 | let level = line.chars().take_while(|c| *c == '#').count(); [INFO] [stdout] ... [INFO] [stdout] 111 | last_level = level; [INFO] [stdout] 112 ~ } [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this `if` statement can be collapsed [INFO] [stdout] --> src/linters/md/rules/image.rs:270:21 [INFO] [stdout] | [INFO] [stdout] 270 | / if !path_str.starts_with("http://") && !path_str.starts_with("https://") { [INFO] [stdout] 271 | | if let Some(base_path) = file { [INFO] [stdout] 272 | | let parent = base_path.parent().unwrap_or_else(|| Path::new(".")); [INFO] [stdout] 273 | | let image_path = parent.join(path_str); [INFO] [stdout] ... | [INFO] [stdout] 287 | | } [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] 270 ~ if !path_str.starts_with("http://") && !path_str.starts_with("https://") [INFO] [stdout] 271 ~ && let Some(base_path) = file { [INFO] [stdout] 272 | let parent = base_path.parent().unwrap_or_else(|| Path::new(".")); [INFO] [stdout] ... [INFO] [stdout] 285 | } [INFO] [stdout] 286 ~ } [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this `if` statement can be collapsed [INFO] [stdout] --> src/linters/md/rules/image.rs:358:13 [INFO] [stdout] | [INFO] [stdout] 358 | / if let Some(start) = line.find("![") { [INFO] [stdout] 359 | | if let Some(end) = line[start..].find(']').map(|v| v + start) { [INFO] [stdout] 360 | | let alt_text = line[start+2..end].trim().to_string(); [INFO] [stdout] 361 | | if !alt_text.is_empty() { [INFO] [stdout] ... | [INFO] [stdout] 378 | | } [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] 358 ~ if let Some(start) = line.find("![") [INFO] [stdout] 359 ~ && let Some(end) = line[start..].find(']').map(|v| v + start) { [INFO] [stdout] 360 | let alt_text = line[start+2..end].trim().to_string(); [INFO] [stdout] ... [INFO] [stdout] 376 | } [INFO] [stdout] 377 ~ } [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this `if` statement can be collapsed [INFO] [stdout] --> src/linters/md/rules/list.rs:44:13 [INFO] [stdout] | [INFO] [stdout] 44 | / if is_list { [INFO] [stdout] 45 | | if !prev_was_list && i > 0 && !source.lines().nth(i-1).unwrap_or("").trim().is_empty() { [INFO] [stdout] 46 | | report.push(LintError { [INFO] [stdout] 47 | | file: file.map(|p| p.to_path_buf()), [INFO] [stdout] ... | [INFO] [stdout] 63 | | } [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] 44 ~ if is_list [INFO] [stdout] 45 ~ && !prev_was_list && i > 0 && !source.lines().nth(i-1).unwrap_or("").trim().is_empty() { [INFO] [stdout] 46 | report.push(LintError { [INFO] [stdout] ... [INFO] [stdout] 61 | }); [INFO] [stdout] 62 ~ } [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this `if` statement can be collapsed [INFO] [stdout] --> src/linters/md/rules/list.rs:93:17 [INFO] [stdout] | [INFO] [stdout] 93 | / if let Some(prev) = current_marker { [INFO] [stdout] 94 | | if prev != marker { [INFO] [stdout] 95 | | report.push(LintError { [INFO] [stdout] 96 | | file: file.map(|p| p.to_path_buf()), [INFO] [stdout] ... | [INFO] [stdout] 106 | | } [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] 93 ~ if let Some(prev) = current_marker [INFO] [stdout] 94 ~ && prev != marker { [INFO] [stdout] 95 | report.push(LintError { [INFO] [stdout] ... [INFO] [stdout] 104 | }); [INFO] [stdout] 105 ~ } [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this `if` statement can be collapsed [INFO] [stdout] --> src/linters/md/rules/list.rs:257:13 [INFO] [stdout] | [INFO] [stdout] 257 | / if let Some(pos) = trimmed.find('.') { [INFO] [stdout] 258 | | if let Ok(num) = trimmed[..pos].parse::() { [INFO] [stdout] 259 | | if num != expected_number { [INFO] [stdout] 260 | | report.push(LintError { [INFO] [stdout] ... | [INFO] [stdout] 273 | | } [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] 257 ~ if let Some(pos) = trimmed.find('.') [INFO] [stdout] 258 ~ && let Ok(num) = trimmed[..pos].parse::() { [INFO] [stdout] 259 | if num != expected_number { [INFO] [stdout] ... [INFO] [stdout] 271 | expected_number = num + 1; [INFO] [stdout] 272 ~ } [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this `if` statement can be collapsed [INFO] [stdout] --> src/linters/md/rules/table.rs:144:13 [INFO] [stdout] | [INFO] [stdout] 144 | / if trimmed.contains('|') { [INFO] [stdout] 145 | | if !trimmed.starts_with('|') || !trimmed.ends_with('|') { [INFO] [stdout] 146 | | report.push(LintError { [INFO] [stdout] 147 | | file: file.map(|p| p.to_path_buf()), [INFO] [stdout] ... | [INFO] [stdout] 157 | | } [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] 144 ~ if trimmed.contains('|') [INFO] [stdout] 145 ~ && (!trimmed.starts_with('|') || !trimmed.ends_with('|')) { [INFO] [stdout] 146 | report.push(LintError { [INFO] [stdout] ... [INFO] [stdout] 155 | }); [INFO] [stdout] 156 ~ } [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: length comparison to zero [INFO] [stdout] --> src/linters/md/rules/table.rs:266:20 [INFO] [stdout] | [INFO] [stdout] 266 | if cells.len() == 0 { [INFO] [stdout] | ^^^^^^^^^^^^^^^^ help: using `is_empty` is clearer and more explicit: `cells.is_empty()` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#len_zero [INFO] [stdout] = note: `#[warn(clippy::len_zero)]` on by default [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this boolean expression can be simplified [INFO] [stdout] --> src/linters/php/mod.rs:238:57 [INFO] [stdout] | [INFO] [stdout] 238 | if line.trim_start().starts_with("use ") && !source.matches(line.trim()).skip(1).next().is_some() { [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: try: `source.matches(line.trim()).skip(1).next().is_none()` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#nonminimal_bool [INFO] [stdout] = note: `#[warn(clippy::nonminimal_bool)]` on by default [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: called `skip(..).next()` on an iterator [INFO] [stdout] --> src/linters/php/mod.rs:238:85 [INFO] [stdout] | [INFO] [stdout] 238 | if line.trim_start().starts_with("use ") && !source.matches(line.trim()).skip(1).next().is_some() { [INFO] [stdout] | ^^^^^^^^^^^^^^^ help: use `nth` instead: `.nth(1)` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#iter_skip_next [INFO] [stdout] = note: `#[warn(clippy::iter_skip_next)]` on by default [INFO] [stdout] [INFO] [stdout] [INFO] [stderr] Finished `dev` profile [unoptimized + debuginfo] target(s) in 1.80s [INFO] running `Command { std: "docker" "inspect" "68398747867b0f39ec97fbb4da7e42e32d98675125a906da322b81b1430b81e3", kill_on_drop: false }` [INFO] running `Command { std: "docker" "rm" "-f" "68398747867b0f39ec97fbb4da7e42e32d98675125a906da322b81b1430b81e3", kill_on_drop: false }` [INFO] [stdout] 68398747867b0f39ec97fbb4da7e42e32d98675125a906da322b81b1430b81e3