[INFO] cloning repository https://github.com/keatinge/rust-html-parser [INFO] running `Command { std: "git" "-c" "credential.helper=" "-c" "credential.helper=/workspace/cargo-home/bin/git-credential-null" "clone" "--bare" "https://github.com/keatinge/rust-html-parser" "/workspace/cache/git-repos/https%3A%2F%2Fgithub.com%2Fkeatinge%2Frust-html-parser", kill_on_drop: false }` [INFO] [stderr] Cloning into bare repository '/workspace/cache/git-repos/https%3A%2F%2Fgithub.com%2Fkeatinge%2Frust-html-parser'... [INFO] running `Command { std: "git" "rev-parse" "HEAD", kill_on_drop: false }` [INFO] [stdout] 14a9d43b776bbce0f4a98ac3c3d3761150bf66cb [INFO] linting keatinge/rust-html-parser against nightly for clippy-nonminimal_bool-denied [INFO] running `Command { std: "git" "clone" "/workspace/cache/git-repos/https%3A%2F%2Fgithub.com%2Fkeatinge%2Frust-html-parser" "/workspace/builds/worker-2-tc1/source", kill_on_drop: false }` [INFO] [stderr] Cloning into '/workspace/builds/worker-2-tc1/source'... [INFO] [stderr] done. [INFO] started tweaking git repo https://github.com/keatinge/rust-html-parser [INFO] finished tweaking git repo https://github.com/keatinge/rust-html-parser [INFO] tweaked toml for git repo https://github.com/keatinge/rust-html-parser written to /workspace/builds/worker-2-tc1/source/Cargo.toml [INFO] validating manifest of git repo https://github.com/keatinge/rust-html-parser on toolchain nightly [INFO] running `Command { std: CARGO_HOME="/workspace/cargo-home" RUSTUP_HOME="/workspace/rustup-home" "/workspace/cargo-home/bin/cargo" "+nightly" "metadata" "--manifest-path" "Cargo.toml" "--no-deps", kill_on_drop: false }` [INFO] crate git repo https://github.com/keatinge/rust-html-parser already has a lockfile, it will not be regenerated [INFO] running `Command { std: CARGO_HOME="/workspace/cargo-home" RUSTUP_HOME="/workspace/rustup-home" "/workspace/cargo-home/bin/cargo" "+nightly" "fetch" "--manifest-path" "Cargo.toml", kill_on_drop: false }` [INFO] [stderr] warning: `package.edition` is unspecified, defaulting to `2015` while the latest is `2024` [INFO] running `Command { std: "docker" "create" "-v" "/var/lib/crater-agent-workspace/builds/worker-2-tc1/target:/opt/rustwide/target:rw,Z" "-v" "/var/lib/crater-agent-workspace/builds/worker-2-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] e2618f8d2888d2edf5255a120734da58f65f7e8c6c903b306c508336b749e9f8 [INFO] running `Command { std: "docker" "start" "-a" "e2618f8d2888d2edf5255a120734da58f65f7e8c6c903b306c508336b749e9f8", kill_on_drop: false }` [INFO] running `Command { std: "docker" "inspect" "e2618f8d2888d2edf5255a120734da58f65f7e8c6c903b306c508336b749e9f8", kill_on_drop: false }` [INFO] running `Command { std: "docker" "rm" "-f" "e2618f8d2888d2edf5255a120734da58f65f7e8c6c903b306c508336b749e9f8", kill_on_drop: false }` [INFO] [stdout] e2618f8d2888d2edf5255a120734da58f65f7e8c6c903b306c508336b749e9f8 [INFO] running `Command { std: "docker" "create" "-v" "/var/lib/crater-agent-workspace/builds/worker-2-tc1/target:/opt/rustwide/target:rw,Z" "-v" "/var/lib/crater-agent-workspace/builds/worker-2-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] d77c72a210325a85ed7fb9fe85e84467884a12b04c11028de58f6fedacebe172 [INFO] running `Command { std: "docker" "start" "-a" "d77c72a210325a85ed7fb9fe85e84467884a12b04c11028de58f6fedacebe172", kill_on_drop: false }` [INFO] [stderr] warning: `package.edition` is unspecified, defaulting to `2015` while the latest is `2024` [INFO] [stderr] Checking html_parser_f v0.1.0 (/opt/rustwide/workdir) [INFO] [stdout] warning: `...` range patterns are deprecated [INFO] [stdout] --> src/lib.rs:119:16 [INFO] [stdout] | [INFO] [stdout] 119 | '0'...'9' => continue, [INFO] [stdout] | ^^^ help: use `..=` for an inclusive range [INFO] [stdout] | [INFO] [stdout] = warning: this is accepted in the current edition (Rust 2015) but is a hard error in Rust 2021! [INFO] [stdout] = note: for more information, see [INFO] [stdout] = note: `#[warn(ellipsis_inclusive_range_patterns)]` (part of `#[warn(rust_2021_compatibility)]`) on by default [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: `...` range patterns are deprecated [INFO] [stdout] --> src/lib.rs:120:16 [INFO] [stdout] | [INFO] [stdout] 120 | 'a'...'z' => continue, [INFO] [stdout] | ^^^ help: use `..=` for an inclusive range [INFO] [stdout] | [INFO] [stdout] = warning: this is accepted in the current edition (Rust 2015) but is a hard error in Rust 2021! [INFO] [stdout] = note: for more information, see [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: `...` range patterns are deprecated [INFO] [stdout] --> src/lib.rs:121:16 [INFO] [stdout] | [INFO] [stdout] 121 | 'A'...'Z' => continue, [INFO] [stdout] | ^^^ help: use `..=` for an inclusive range [INFO] [stdout] | [INFO] [stdout] = warning: this is accepted in the current edition (Rust 2015) but is a hard error in Rust 2021! [INFO] [stdout] = note: for more information, see [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: redundant field names in struct initialization [INFO] [stdout] --> src/lib.rs:307:49 [INFO] [stdout] | [INFO] [stdout] 307 | HtmlNode::El(Element {tag_data: td, children: children, token_count: 1_usize}) [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^ help: replace it with: `children` [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/lib.rs:310:49 [INFO] [stdout] | [INFO] [stdout] 310 | HtmlNode::El(Element {tag_data: td, children: children, token_count: 2_usize}) [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^ help: replace it with: `children` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#redundant_field_names [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: redundant field names in struct initialization [INFO] [stdout] --> src/lib.rs:329:50 [INFO] [stdout] | [INFO] [stdout] 329 | HtmlNode::El(Element {tag_data: &td, children: children, token_count: tokens_used}) [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^ help: replace it with: `children` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#redundant_field_names [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: manual implementation of `str::repeat` using iterators [INFO] [stdout] --> src/lib.rs:15:26 [INFO] [stdout] | [INFO] [stdout] 15 | let indent_str = iter::repeat(' ').take(indent).collect::(); [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: try: `" ".repeat(indent)` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#manual_str_repeat [INFO] [stdout] = note: `#[warn(clippy::manual_str_repeat)]` on by default [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this `repeat().take()` can be written more concisely [INFO] [stdout] --> src/lib.rs:15:26 [INFO] [stdout] | [INFO] [stdout] 15 | let indent_str = iter::repeat(' ').take(indent).collect::(); [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: consider using `repeat_n()` instead: `std::iter::repeat_n(' ', indent)` [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: using `write!()` with a format string that ends in a single newline [INFO] [stdout] --> src/lib.rs:19:17 [INFO] [stdout] | [INFO] [stdout] 19 | write!(f, "{}<{}>\n", indent_str, el.tag_data.name)?; [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#write_with_newline [INFO] [stdout] = note: `#[warn(clippy::write_with_newline)]` on by default [INFO] [stdout] help: use `writeln!` instead [INFO] [stdout] | [INFO] [stdout] 19 - write!(f, "{}<{}>\n", indent_str, el.tag_data.name)?; [INFO] [stdout] 19 + writeln!(f, "{}<{}>", indent_str, el.tag_data.name)?; [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this expression borrows a value the compiler would automatically borrow [INFO] [stdout] --> src/lib.rs:20:39 [INFO] [stdout] | [INFO] [stdout] 20 | for (i, ref child) in (&el.children).iter().enumerate() { [INFO] [stdout] | ^^^^^^^^^^^^^^ help: change this to: `el.children` [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 expression creates a reference which is immediately dereferenced by the compiler [INFO] [stdout] --> src/lib.rs:21:59 [INFO] [stdout] | [INFO] [stdout] 21 | child.display_as_tree(indent+4_usize, &mut f)?; [INFO] [stdout] | ^^^^^^ help: change this to: `f` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_borrow [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: using `write!()` with a format string that ends in a single newline [INFO] [stdout] --> src/lib.rs:25:25 [INFO] [stdout] | [INFO] [stdout] 25 | write!(f, "\n")?; [INFO] [stdout] | ^^^^^^^^^^^^^^^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#write_with_newline [INFO] [stdout] help: use `writeln!` instead [INFO] [stdout] | [INFO] [stdout] 25 - write!(f, "\n")?; [INFO] [stdout] 25 + writeln!(f)?; [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: length comparison to zero [INFO] [stdout] --> src/lib.rs:29:20 [INFO] [stdout] | [INFO] [stdout] 29 | if el.children.len() > 0 { [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^ help: using `!is_empty` is clearer and more explicit: `!el.children.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 pattern creates a reference to a reference [INFO] [stdout] --> src/lib.rs:20:25 [INFO] [stdout] | [INFO] [stdout] 20 | for (i, ref child) in (&el.children).iter().enumerate() { [INFO] [stdout] | ^^^^^^^^^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_borrow [INFO] [stdout] help: try [INFO] [stdout] | [INFO] [stdout] 20 - for (i, ref child) in (&el.children).iter().enumerate() { [INFO] [stdout] 20 + for (i, child) in (&el.children).iter().enumerate() { [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this pattern creates a reference to a reference [INFO] [stdout] --> src/lib.rs:36:28 [INFO] [stdout] | [INFO] [stdout] 36 | HtmlNode::Text(ref txt) => { [INFO] [stdout] | ^^^^^^^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_borrow [INFO] [stdout] help: try [INFO] [stdout] | [INFO] [stdout] 36 - HtmlNode::Text(ref txt) => { [INFO] [stdout] 36 + HtmlNode::Text(txt) => { [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this expression creates a reference which is immediately dereferenced by the compiler [INFO] [stdout] --> src/lib.rs:53:33 [INFO] [stdout] | [INFO] [stdout] 53 | self.display_as_tree(0, &mut f) [INFO] [stdout] | ^^^^^^ help: change this to: `f` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_borrow [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: `...` range patterns are deprecated [INFO] [stdout] --> src/lib.rs:119:16 [INFO] [stdout] | [INFO] [stdout] 119 | '0'...'9' => continue, [INFO] [stdout] | ^^^ help: use `..=` for an inclusive range [INFO] [stdout] | [INFO] [stdout] = warning: this is accepted in the current edition (Rust 2015) but is a hard error in Rust 2021! [INFO] [stdout] = note: for more information, see [INFO] [stdout] = note: `#[warn(ellipsis_inclusive_range_patterns)]` (part of `#[warn(rust_2021_compatibility)]`) on by default [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: `...` range patterns are deprecated [INFO] [stdout] --> src/lib.rs:120:16 [INFO] [stdout] | [INFO] [stdout] 120 | 'a'...'z' => continue, [INFO] [stdout] | ^^^ help: use `..=` for an inclusive range [INFO] [stdout] | [INFO] [stdout] = warning: this is accepted in the current edition (Rust 2015) but is a hard error in Rust 2021! [INFO] [stdout] = note: for more information, see [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: `...` range patterns are deprecated [INFO] [stdout] --> src/lib.rs:121:16 [INFO] [stdout] | [INFO] [stdout] 121 | 'A'...'Z' => continue, [INFO] [stdout] | ^^^ help: use `..=` for an inclusive range [INFO] [stdout] | [INFO] [stdout] = warning: this is accepted in the current edition (Rust 2015) but is a hard error in Rust 2021! [INFO] [stdout] = note: for more information, see [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: redundant field names in struct initialization [INFO] [stdout] --> src/lib.rs:307:49 [INFO] [stdout] | [INFO] [stdout] 307 | HtmlNode::El(Element {tag_data: td, children: children, token_count: 1_usize}) [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^ help: replace it with: `children` [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/lib.rs:310:49 [INFO] [stdout] | [INFO] [stdout] 310 | HtmlNode::El(Element {tag_data: td, children: children, token_count: 2_usize}) [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^ help: replace it with: `children` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#redundant_field_names [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: redundant field names in struct initialization [INFO] [stdout] --> src/lib.rs:329:50 [INFO] [stdout] | [INFO] [stdout] 329 | HtmlNode::El(Element {tag_data: &td, children: children, token_count: tokens_used}) [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^ help: replace it with: `children` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#redundant_field_names [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: you don't need to add `&` to all patterns [INFO] [stdout] --> src/lib.rs:94:9 [INFO] [stdout] | [INFO] [stdout] 94 | / match self { [INFO] [stdout] 95 | | &Token::VoidTag(ref td) => write!(f, "", td), [INFO] [stdout] 96 | | &Token::OpenTag(ref td) => write!(f, "", td), [INFO] [stdout] 97 | | &Token::CloseTag(ref td) => write!(f, "", td), [INFO] [stdout] 98 | | &Token::Text(ref td) => write!(f, "{:?}", td) [INFO] [stdout] 99 | | } [INFO] [stdout] | |_________^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#match_ref_pats [INFO] [stdout] = note: `#[warn(clippy::match_ref_pats)]` on by default [INFO] [stdout] help: instead of prefixing all patterns with `&`, you can dereference the expression [INFO] [stdout] | [INFO] [stdout] 94 ~ match *self { [INFO] [stdout] 95 ~ Token::VoidTag(ref td) => write!(f, "", td), [INFO] [stdout] 96 ~ Token::OpenTag(ref td) => write!(f, "", td), [INFO] [stdout] 97 ~ Token::CloseTag(ref td) => write!(f, "", td), [INFO] [stdout] 98 ~ Token::Text(ref td) => write!(f, "{:?}", td) [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: dereferencing a tuple pattern where every element takes a reference [INFO] [stdout] --> src/lib.rs:95:13 [INFO] [stdout] | [INFO] [stdout] 95 | &Token::VoidTag(ref td) => write!(f, "", td), [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_borrowed_reference [INFO] [stdout] = note: `#[warn(clippy::needless_borrowed_reference)]` on by default [INFO] [stdout] help: try removing the `&` and `ref` parts [INFO] [stdout] | [INFO] [stdout] 95 - &Token::VoidTag(ref td) => write!(f, "", td), [INFO] [stdout] 95 + Token::VoidTag(td) => write!(f, "", td), [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: dereferencing a tuple pattern where every element takes a reference [INFO] [stdout] --> src/lib.rs:96:13 [INFO] [stdout] | [INFO] [stdout] 96 | &Token::OpenTag(ref td) => write!(f, "", td), [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_borrowed_reference [INFO] [stdout] help: try removing the `&` and `ref` parts [INFO] [stdout] | [INFO] [stdout] 96 - &Token::OpenTag(ref td) => write!(f, "", td), [INFO] [stdout] 96 + Token::OpenTag(td) => write!(f, "", td), [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: dereferencing a tuple pattern where every element takes a reference [INFO] [stdout] --> src/lib.rs:97:13 [INFO] [stdout] | [INFO] [stdout] 97 | &Token::CloseTag(ref td) => write!(f, "", td), [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_borrowed_reference [INFO] [stdout] help: try removing the `&` and `ref` parts [INFO] [stdout] | [INFO] [stdout] 97 - &Token::CloseTag(ref td) => write!(f, "", td), [INFO] [stdout] 97 + Token::CloseTag(td) => write!(f, "", td), [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: dereferencing a tuple pattern where every element takes a reference [INFO] [stdout] --> src/lib.rs:98:13 [INFO] [stdout] | [INFO] [stdout] 98 | &Token::Text(ref td) => write!(f, "{:?}", td) [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_borrowed_reference [INFO] [stdout] help: try removing the `&` and `ref` parts [INFO] [stdout] | [INFO] [stdout] 98 - &Token::Text(ref td) => write!(f, "{:?}", td) [INFO] [stdout] 98 + Token::Text(td) => write!(f, "{:?}", td) [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: using `contains()` instead of `iter().any()` is more efficient [INFO] [stdout] --> src/lib.rs:107:5 [INFO] [stdout] | [INFO] [stdout] 107 | void_tags.iter().any(|x| tag_name == *x) [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: try: `void_tags.contains(&tag_name)` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#manual_contains [INFO] [stdout] = note: `#[warn(clippy::manual_contains)]` on by default [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: the following explicit lifetimes could be elided: 'a [INFO] [stdout] --> src/lib.rs:110:11 [INFO] [stdout] | [INFO] [stdout] 110 | fn to_str<'a>(data:&'a[u8]) -> &'a str { [INFO] [stdout] | ^^ ^^ ^^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_lifetimes [INFO] [stdout] = note: `#[warn(clippy::needless_lifetimes)]` on by default [INFO] [stdout] help: elide the lifetimes [INFO] [stdout] | [INFO] [stdout] 110 - fn to_str<'a>(data:&'a[u8]) -> &'a str { [INFO] [stdout] 110 + fn to_str(data:&[u8]) -> &str { [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this expression creates a reference which is immediately dereferenced by the compiler [INFO] [stdout] --> src/lib.rs:111:27 [INFO] [stdout] | [INFO] [stdout] 111 | ::std::str::from_utf8(&data).unwrap() [INFO] [stdout] | ^^^^^ help: change this to: `data` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_borrow [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: casting a character literal to `u8` truncates [INFO] [stdout] --> src/lib.rs:135:38 [INFO] [stdout] | [INFO] [stdout] 135 | if tok_text.as_bytes()[0] != '<' as u8 { [INFO] [stdout] | ^^^^^^^^^ help: use a byte literal instead: `b'<'` [INFO] [stdout] | [INFO] [stdout] = note: `char` is four bytes wide, but `u8` is a single byte [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#char_lit_as_u8 [INFO] [stdout] = note: `#[warn(clippy::char_lit_as_u8)]` on by default [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: casting a character literal to `u8` truncates [INFO] [stdout] --> src/lib.rs:141:54 [INFO] [stdout] | [INFO] [stdout] 141 | ... while tok_text.as_bytes()[name_end_chr_i] != (' ' as u8) && tok_text.as_bytes()[name_end_chr_i] != ('/' as u8) && tok_text.as... [INFO] [stdout] | ^^^^^^^^^^^ help: use a byte literal instead: `b' '` [INFO] [stdout] | [INFO] [stdout] = note: `char` is four bytes wide, but `u8` is a single byte [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#char_lit_as_u8 [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: casting a character literal to `u8` truncates [INFO] [stdout] --> src/lib.rs:141:108 [INFO] [stdout] | [INFO] [stdout] 141 | ...ok_text.as_bytes()[name_end_chr_i] != ('/' as u8) && tok_text.as_bytes()[name_end_chr_i] != ('>' as u8) && tok_text.as_bytes()[n... [INFO] [stdout] | ^^^^^^^^^^^ help: use a byte literal instead: `b'/'` [INFO] [stdout] | [INFO] [stdout] = note: `char` is four bytes wide, but `u8` is a single byte [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#char_lit_as_u8 [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: casting a character literal to `u8` truncates [INFO] [stdout] --> src/lib.rs:141:162 [INFO] [stdout] | [INFO] [stdout] 141 | ...ok_text.as_bytes()[name_end_chr_i] != ('>' as u8) && tok_text.as_bytes()[name_end_chr_i] != '\n' as u8 && tok_text.as_bytes()[na... [INFO] [stdout] | ^^^^^^^^^^^ help: use a byte literal instead: `b'>'` [INFO] [stdout] | [INFO] [stdout] = note: `char` is four bytes wide, but `u8` is a single byte [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#char_lit_as_u8 [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: casting a character literal to `u8` truncates [INFO] [stdout] --> src/lib.rs:141:216 [INFO] [stdout] | [INFO] [stdout] 141 | ...ok_text.as_bytes()[name_end_chr_i] != '\n' as u8 && tok_text.as_bytes()[name_end_chr_i] != '\r' as u8{ [INFO] [stdout] | ^^^^^^^^^^ help: use a byte literal instead: `b'\n'` [INFO] [stdout] | [INFO] [stdout] = note: `char` is four bytes wide, but `u8` is a single byte [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#char_lit_as_u8 [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: casting a character literal to `u8` truncates [INFO] [stdout] --> src/lib.rs:141:269 [INFO] [stdout] | [INFO] [stdout] 141 | ...ok_text.as_bytes()[name_end_chr_i] != '\r' as u8{ [INFO] [stdout] | ^^^^^^^^^^ help: use a byte literal instead: `b'\r'` [INFO] [stdout] | [INFO] [stdout] = note: `char` is four bytes wide, but `u8` is a single byte [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#char_lit_as_u8 [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: casting a character literal to `u8` truncates [INFO] [stdout] --> src/lib.rs:146:51 [INFO] [stdout] | [INFO] [stdout] 146 | if tok_text.as_bytes()[name_end_chr_i] == '/' as u8 || is_void_tag_name(to_str(&tok_text.as_bytes()[1..name_end_chr_i])){ [INFO] [stdout] | ^^^^^^^^^ help: use a byte literal instead: `b'/'` [INFO] [stdout] | [INFO] [stdout] = note: `char` is four bytes wide, but `u8` is a single byte [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#char_lit_as_u8 [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: casting a character literal to `u8` truncates [INFO] [stdout] --> src/lib.rs:154:43 [INFO] [stdout] | [INFO] [stdout] 154 | else if tok_text.as_bytes()[1] == '/' as u8 { [INFO] [stdout] | ^^^^^^^^^ help: use a byte literal instead: `b'/'` [INFO] [stdout] | [INFO] [stdout] = note: `char` is four bytes wide, but `u8` is a single byte [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#char_lit_as_u8 [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: method `from_str` can be confused for the standard trait method `std::str::FromStr::from_str` [INFO] [stdout] --> src/lib.rs:169:5 [INFO] [stdout] | [INFO] [stdout] 169 | / pub fn from_str(s: &'a str) -> Token<'a> { [INFO] [stdout] 170 | | Token::from_str_checked(s).expect("Called from_str on an invalid token") [INFO] [stdout] 171 | | } [INFO] [stdout] | |_____^ [INFO] [stdout] | [INFO] [stdout] = help: consider implementing the trait `std::str::FromStr` or choosing a less ambiguous method name [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#should_implement_trait [INFO] [stdout] = note: `#[warn(clippy::should_implement_trait)]` on by default [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this boolean expression can be simplified [INFO] [stdout] --> src/lib.rs:250:19 [INFO] [stdout] | [INFO] [stdout] 250 | while !(bytes[closing_bracket_i] == '>' as u8 && !inside_a_string){ [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: try: `bytes[closing_bracket_i] != '>' as u8 || inside_a_string` [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: casting a character literal to `u8` truncates [INFO] [stdout] --> src/lib.rs:226:40 [INFO] [stdout] | [INFO] [stdout] 226 | ... while bytes[first_non_ws_i] == ' ' as u8 || bytes[first_non_ws_i] == '\n' as u8 || bytes[first_non_ws_i] == '\r' as u8 || byt... [INFO] [stdout] | ^^^^^^^^^ help: use a byte literal instead: `b' '` [INFO] [stdout] | [INFO] [stdout] = note: `char` is four bytes wide, but `u8` is a single byte [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#char_lit_as_u8 [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: casting a character literal to `u8` truncates [INFO] [stdout] --> src/lib.rs:226:78 [INFO] [stdout] | [INFO] [stdout] 226 | ... while bytes[first_non_ws_i] == ' ' as u8 || bytes[first_non_ws_i] == '\n' as u8 || bytes[first_non_ws_i] == '\r' as u8 || byt... [INFO] [stdout] | ^^^^^^^^^^ help: use a byte literal instead: `b'\n'` [INFO] [stdout] | [INFO] [stdout] = note: `char` is four bytes wide, but `u8` is a single byte [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#char_lit_as_u8 [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: casting a character literal to `u8` truncates [INFO] [stdout] --> src/lib.rs:226:117 [INFO] [stdout] | [INFO] [stdout] 226 | ...\n' as u8 || bytes[first_non_ws_i] == '\r' as u8 || bytes[first_non_ws_i] == '\t' as u8 { [INFO] [stdout] | ^^^^^^^^^^ help: use a byte literal instead: `b'\r'` [INFO] [stdout] | [INFO] [stdout] = note: `char` is four bytes wide, but `u8` is a single byte [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#char_lit_as_u8 [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: casting a character literal to `u8` truncates [INFO] [stdout] --> src/lib.rs:226:156 [INFO] [stdout] | [INFO] [stdout] 226 | ...\r' as u8 || bytes[first_non_ws_i] == '\t' as u8 { [INFO] [stdout] | ^^^^^^^^^^ help: use a byte literal instead: `b'\t'` [INFO] [stdout] | [INFO] [stdout] = note: `char` is four bytes wide, but `u8` is a single byte [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#char_lit_as_u8 [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: casting a character literal to `u8` truncates [INFO] [stdout] --> src/lib.rs:250:49 [INFO] [stdout] | [INFO] [stdout] 250 | while !(bytes[closing_bracket_i] == '>' as u8 && !inside_a_string){ [INFO] [stdout] | ^^^^^^^^^ help: use a byte literal instead: `b'>'` [INFO] [stdout] | [INFO] [stdout] = note: `char` is four bytes wide, but `u8` is a single byte [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#char_lit_as_u8 [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: casting a character literal to `u8` truncates [INFO] [stdout] --> src/lib.rs:252:68 [INFO] [stdout] | [INFO] [stdout] 252 | if !inside_a_string && bytes[closing_bracket_i] == '<' as u8 { [INFO] [stdout] | ^^^^^^^^^ help: use a byte literal instead: `b'<'` [INFO] [stdout] | [INFO] [stdout] = note: `char` is four bytes wide, but `u8` is a single byte [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#char_lit_as_u8 [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: casting a character literal to `u8` truncates [INFO] [stdout] --> src/lib.rs:258:48 [INFO] [stdout] | [INFO] [stdout] 258 | if bytes[closing_bracket_i] == '"' as u8 { [INFO] [stdout] | ^^^^^^^^^ help: use a byte literal instead: `b'"'` [INFO] [stdout] | [INFO] [stdout] = note: `char` is four bytes wide, but `u8` is a single byte [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#char_lit_as_u8 [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: casting a character literal to `u8` truncates [INFO] [stdout] --> src/lib.rs:274:52 [INFO] [stdout] | [INFO] [stdout] 274 | while bytes[next_opening_bracket_i] != '<' as u8 { [INFO] [stdout] | ^^^^^^^^^ help: use a byte literal instead: `b'<'` [INFO] [stdout] | [INFO] [stdout] = note: `char` is four bytes wide, but `u8` is a single byte [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#char_lit_as_u8 [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this expression creates a reference which is immediately dereferenced by the compiler [INFO] [stdout] --> src/lib.rs:309:55 [INFO] [stdout] | [INFO] [stdout] 309 | Token::OpenTag(ref td) if next_element.closes(&first_element) => { [INFO] [stdout] | ^^^^^^^^^^^^^^ help: change this to: `first_element` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_borrow [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this expression creates a reference which is immediately dereferenced by the compiler [INFO] [stdout] --> src/lib.rs:318:48 [INFO] [stdout] | [INFO] [stdout] 318 | while !tokens[snd_el_index].closes(&first_element) { [INFO] [stdout] | ^^^^^^^^^^^^^^ help: change this to: `first_element` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_borrow [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this expression creates a reference which is immediately dereferenced by the compiler [INFO] [stdout] --> src/lib.rs:329:45 [INFO] [stdout] | [INFO] [stdout] 329 | HtmlNode::El(Element {tag_data: &td, children: children, token_count: tokens_used}) [INFO] [stdout] | ^^^ help: change this to: `td` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_borrow [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this pattern creates a reference to a reference [INFO] [stdout] --> src/lib.rs:303:21 [INFO] [stdout] | [INFO] [stdout] 303 | Token::Text(ref str_data) => { [INFO] [stdout] | ^^^^^^^^^^^^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_borrow [INFO] [stdout] help: try [INFO] [stdout] | [INFO] [stdout] 303 - Token::Text(ref str_data) => { [INFO] [stdout] 303 + Token::Text(str_data) => { [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: manual implementation of `str::repeat` using iterators [INFO] [stdout] --> src/lib.rs:15:26 [INFO] [stdout] | [INFO] [stdout] 15 | let indent_str = iter::repeat(' ').take(indent).collect::(); [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: try: `" ".repeat(indent)` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#manual_str_repeat [INFO] [stdout] = note: `#[warn(clippy::manual_str_repeat)]` on by default [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this `repeat().take()` can be written more concisely [INFO] [stdout] --> src/lib.rs:15:26 [INFO] [stdout] | [INFO] [stdout] 15 | let indent_str = iter::repeat(' ').take(indent).collect::(); [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: consider using `repeat_n()` instead: `std::iter::repeat_n(' ', indent)` [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: using `write!()` with a format string that ends in a single newline [INFO] [stdout] --> src/lib.rs:19:17 [INFO] [stdout] | [INFO] [stdout] 19 | write!(f, "{}<{}>\n", indent_str, el.tag_data.name)?; [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#write_with_newline [INFO] [stdout] = note: `#[warn(clippy::write_with_newline)]` on by default [INFO] [stdout] help: use `writeln!` instead [INFO] [stdout] | [INFO] [stdout] 19 - write!(f, "{}<{}>\n", indent_str, el.tag_data.name)?; [INFO] [stdout] 19 + writeln!(f, "{}<{}>", indent_str, el.tag_data.name)?; [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this expression borrows a value the compiler would automatically borrow [INFO] [stdout] --> src/lib.rs:20:39 [INFO] [stdout] | [INFO] [stdout] 20 | for (i, ref child) in (&el.children).iter().enumerate() { [INFO] [stdout] | ^^^^^^^^^^^^^^ help: change this to: `el.children` [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 expression creates a reference which is immediately dereferenced by the compiler [INFO] [stdout] --> src/lib.rs:21:59 [INFO] [stdout] | [INFO] [stdout] 21 | child.display_as_tree(indent+4_usize, &mut f)?; [INFO] [stdout] | ^^^^^^ help: change this to: `f` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_borrow [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: using `write!()` with a format string that ends in a single newline [INFO] [stdout] --> src/lib.rs:25:25 [INFO] [stdout] | [INFO] [stdout] 25 | write!(f, "\n")?; [INFO] [stdout] | ^^^^^^^^^^^^^^^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#write_with_newline [INFO] [stdout] help: use `writeln!` instead [INFO] [stdout] | [INFO] [stdout] 25 - write!(f, "\n")?; [INFO] [stdout] 25 + writeln!(f)?; [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: length comparison to zero [INFO] [stdout] --> src/lib.rs:29:20 [INFO] [stdout] | [INFO] [stdout] 29 | if el.children.len() > 0 { [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^ help: using `!is_empty` is clearer and more explicit: `!el.children.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 pattern creates a reference to a reference [INFO] [stdout] --> src/lib.rs:20:25 [INFO] [stdout] | [INFO] [stdout] 20 | for (i, ref child) in (&el.children).iter().enumerate() { [INFO] [stdout] | ^^^^^^^^^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_borrow [INFO] [stdout] help: try [INFO] [stdout] | [INFO] [stdout] 20 - for (i, ref child) in (&el.children).iter().enumerate() { [INFO] [stdout] 20 + for (i, child) in (&el.children).iter().enumerate() { [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this pattern creates a reference to a reference [INFO] [stdout] --> src/lib.rs:36:28 [INFO] [stdout] | [INFO] [stdout] 36 | HtmlNode::Text(ref txt) => { [INFO] [stdout] | ^^^^^^^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_borrow [INFO] [stdout] help: try [INFO] [stdout] | [INFO] [stdout] 36 - HtmlNode::Text(ref txt) => { [INFO] [stdout] 36 + HtmlNode::Text(txt) => { [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this expression creates a reference which is immediately dereferenced by the compiler [INFO] [stdout] --> src/lib.rs:53:33 [INFO] [stdout] | [INFO] [stdout] 53 | self.display_as_tree(0, &mut f) [INFO] [stdout] | ^^^^^^ help: change this to: `f` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_borrow [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: you don't need to add `&` to all patterns [INFO] [stdout] --> src/lib.rs:94:9 [INFO] [stdout] | [INFO] [stdout] 94 | / match self { [INFO] [stdout] 95 | | &Token::VoidTag(ref td) => write!(f, "", td), [INFO] [stdout] 96 | | &Token::OpenTag(ref td) => write!(f, "", td), [INFO] [stdout] 97 | | &Token::CloseTag(ref td) => write!(f, "", td), [INFO] [stdout] 98 | | &Token::Text(ref td) => write!(f, "{:?}", td) [INFO] [stdout] 99 | | } [INFO] [stdout] | |_________^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#match_ref_pats [INFO] [stdout] = note: `#[warn(clippy::match_ref_pats)]` on by default [INFO] [stdout] help: instead of prefixing all patterns with `&`, you can dereference the expression [INFO] [stdout] | [INFO] [stdout] 94 ~ match *self { [INFO] [stdout] 95 ~ Token::VoidTag(ref td) => write!(f, "", td), [INFO] [stdout] 96 ~ Token::OpenTag(ref td) => write!(f, "", td), [INFO] [stdout] 97 ~ Token::CloseTag(ref td) => write!(f, "", td), [INFO] [stdout] 98 ~ Token::Text(ref td) => write!(f, "{:?}", td) [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: dereferencing a tuple pattern where every element takes a reference [INFO] [stdout] --> src/lib.rs:95:13 [INFO] [stdout] | [INFO] [stdout] 95 | &Token::VoidTag(ref td) => write!(f, "", td), [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_borrowed_reference [INFO] [stdout] = note: `#[warn(clippy::needless_borrowed_reference)]` on by default [INFO] [stdout] help: try removing the `&` and `ref` parts [INFO] [stdout] | [INFO] [stdout] 95 - &Token::VoidTag(ref td) => write!(f, "", td), [INFO] [stdout] 95 + Token::VoidTag(td) => write!(f, "", td), [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: dereferencing a tuple pattern where every element takes a reference [INFO] [stdout] --> src/lib.rs:96:13 [INFO] [stdout] | [INFO] [stdout] 96 | &Token::OpenTag(ref td) => write!(f, "", td), [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_borrowed_reference [INFO] [stdout] help: try removing the `&` and `ref` parts [INFO] [stdout] | [INFO] [stdout] 96 - &Token::OpenTag(ref td) => write!(f, "", td), [INFO] [stdout] 96 + Token::OpenTag(td) => write!(f, "", td), [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: dereferencing a tuple pattern where every element takes a reference [INFO] [stdout] --> src/lib.rs:97:13 [INFO] [stdout] | [INFO] [stdout] 97 | &Token::CloseTag(ref td) => write!(f, "", td), [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_borrowed_reference [INFO] [stdout] help: try removing the `&` and `ref` parts [INFO] [stdout] | [INFO] [stdout] 97 - &Token::CloseTag(ref td) => write!(f, "", td), [INFO] [stdout] 97 + Token::CloseTag(td) => write!(f, "", td), [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: dereferencing a tuple pattern where every element takes a reference [INFO] [stdout] --> src/lib.rs:98:13 [INFO] [stdout] | [INFO] [stdout] 98 | &Token::Text(ref td) => write!(f, "{:?}", td) [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_borrowed_reference [INFO] [stdout] help: try removing the `&` and `ref` parts [INFO] [stdout] | [INFO] [stdout] 98 - &Token::Text(ref td) => write!(f, "{:?}", td) [INFO] [stdout] 98 + Token::Text(td) => write!(f, "{:?}", td) [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: using `contains()` instead of `iter().any()` is more efficient [INFO] [stdout] --> src/lib.rs:107:5 [INFO] [stdout] | [INFO] [stdout] 107 | void_tags.iter().any(|x| tag_name == *x) [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: try: `void_tags.contains(&tag_name)` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#manual_contains [INFO] [stdout] = note: `#[warn(clippy::manual_contains)]` on by default [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: the following explicit lifetimes could be elided: 'a [INFO] [stdout] --> src/lib.rs:110:11 [INFO] [stdout] | [INFO] [stdout] 110 | fn to_str<'a>(data:&'a[u8]) -> &'a str { [INFO] [stdout] | ^^ ^^ ^^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_lifetimes [INFO] [stdout] = note: `#[warn(clippy::needless_lifetimes)]` on by default [INFO] [stdout] help: elide the lifetimes [INFO] [stdout] | [INFO] [stdout] 110 - fn to_str<'a>(data:&'a[u8]) -> &'a str { [INFO] [stdout] 110 + fn to_str(data:&[u8]) -> &str { [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this expression creates a reference which is immediately dereferenced by the compiler [INFO] [stdout] --> src/lib.rs:111:27 [INFO] [stdout] | [INFO] [stdout] 111 | ::std::str::from_utf8(&data).unwrap() [INFO] [stdout] | ^^^^^ help: change this to: `data` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_borrow [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: casting a character literal to `u8` truncates [INFO] [stdout] --> src/lib.rs:135:38 [INFO] [stdout] | [INFO] [stdout] 135 | if tok_text.as_bytes()[0] != '<' as u8 { [INFO] [stdout] | ^^^^^^^^^ help: use a byte literal instead: `b'<'` [INFO] [stdout] | [INFO] [stdout] = note: `char` is four bytes wide, but `u8` is a single byte [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#char_lit_as_u8 [INFO] [stdout] = note: `#[warn(clippy::char_lit_as_u8)]` on by default [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: casting a character literal to `u8` truncates [INFO] [stdout] --> src/lib.rs:141:54 [INFO] [stdout] | [INFO] [stdout] 141 | ... while tok_text.as_bytes()[name_end_chr_i] != (' ' as u8) && tok_text.as_bytes()[name_end_chr_i] != ('/' as u8) && tok_text.as... [INFO] [stdout] | ^^^^^^^^^^^ help: use a byte literal instead: `b' '` [INFO] [stdout] | [INFO] [stdout] = note: `char` is four bytes wide, but `u8` is a single byte [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#char_lit_as_u8 [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: casting a character literal to `u8` truncates [INFO] [stdout] --> src/lib.rs:141:108 [INFO] [stdout] | [INFO] [stdout] 141 | ...ok_text.as_bytes()[name_end_chr_i] != ('/' as u8) && tok_text.as_bytes()[name_end_chr_i] != ('>' as u8) && tok_text.as_bytes()[n... [INFO] [stdout] | ^^^^^^^^^^^ help: use a byte literal instead: `b'/'` [INFO] [stdout] | [INFO] [stdout] = note: `char` is four bytes wide, but `u8` is a single byte [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#char_lit_as_u8 [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: casting a character literal to `u8` truncates [INFO] [stdout] --> src/lib.rs:141:162 [INFO] [stdout] | [INFO] [stdout] 141 | ...ok_text.as_bytes()[name_end_chr_i] != ('>' as u8) && tok_text.as_bytes()[name_end_chr_i] != '\n' as u8 && tok_text.as_bytes()[na... [INFO] [stdout] | ^^^^^^^^^^^ help: use a byte literal instead: `b'>'` [INFO] [stdout] | [INFO] [stdout] = note: `char` is four bytes wide, but `u8` is a single byte [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#char_lit_as_u8 [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: casting a character literal to `u8` truncates [INFO] [stdout] --> src/lib.rs:141:216 [INFO] [stdout] | [INFO] [stdout] 141 | ...ok_text.as_bytes()[name_end_chr_i] != '\n' as u8 && tok_text.as_bytes()[name_end_chr_i] != '\r' as u8{ [INFO] [stdout] | ^^^^^^^^^^ help: use a byte literal instead: `b'\n'` [INFO] [stdout] | [INFO] [stdout] = note: `char` is four bytes wide, but `u8` is a single byte [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#char_lit_as_u8 [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: casting a character literal to `u8` truncates [INFO] [stdout] --> src/lib.rs:141:269 [INFO] [stdout] | [INFO] [stdout] 141 | ...ok_text.as_bytes()[name_end_chr_i] != '\r' as u8{ [INFO] [stdout] | ^^^^^^^^^^ help: use a byte literal instead: `b'\r'` [INFO] [stdout] | [INFO] [stdout] = note: `char` is four bytes wide, but `u8` is a single byte [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#char_lit_as_u8 [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: casting a character literal to `u8` truncates [INFO] [stdout] --> src/lib.rs:146:51 [INFO] [stdout] | [INFO] [stdout] 146 | if tok_text.as_bytes()[name_end_chr_i] == '/' as u8 || is_void_tag_name(to_str(&tok_text.as_bytes()[1..name_end_chr_i])){ [INFO] [stdout] | ^^^^^^^^^ help: use a byte literal instead: `b'/'` [INFO] [stdout] | [INFO] [stdout] = note: `char` is four bytes wide, but `u8` is a single byte [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#char_lit_as_u8 [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: casting a character literal to `u8` truncates [INFO] [stdout] --> src/lib.rs:154:43 [INFO] [stdout] | [INFO] [stdout] 154 | else if tok_text.as_bytes()[1] == '/' as u8 { [INFO] [stdout] | ^^^^^^^^^ help: use a byte literal instead: `b'/'` [INFO] [stdout] | [INFO] [stdout] = note: `char` is four bytes wide, but `u8` is a single byte [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#char_lit_as_u8 [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: method `from_str` can be confused for the standard trait method `std::str::FromStr::from_str` [INFO] [stdout] --> src/lib.rs:169:5 [INFO] [stdout] | [INFO] [stdout] 169 | / pub fn from_str(s: &'a str) -> Token<'a> { [INFO] [stdout] 170 | | Token::from_str_checked(s).expect("Called from_str on an invalid token") [INFO] [stdout] 171 | | } [INFO] [stdout] | |_____^ [INFO] [stdout] | [INFO] [stdout] = help: consider implementing the trait `std::str::FromStr` or choosing a less ambiguous method name [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#should_implement_trait [INFO] [stdout] = note: `#[warn(clippy::should_implement_trait)]` on by default [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this boolean expression can be simplified [INFO] [stdout] --> src/lib.rs:250:19 [INFO] [stdout] | [INFO] [stdout] 250 | while !(bytes[closing_bracket_i] == '>' as u8 && !inside_a_string){ [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: try: `bytes[closing_bracket_i] != '>' as u8 || inside_a_string` [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: casting a character literal to `u8` truncates [INFO] [stdout] --> src/lib.rs:226:40 [INFO] [stdout] | [INFO] [stdout] 226 | ... while bytes[first_non_ws_i] == ' ' as u8 || bytes[first_non_ws_i] == '\n' as u8 || bytes[first_non_ws_i] == '\r' as u8 || byt... [INFO] [stdout] | ^^^^^^^^^ help: use a byte literal instead: `b' '` [INFO] [stdout] | [INFO] [stdout] = note: `char` is four bytes wide, but `u8` is a single byte [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#char_lit_as_u8 [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: casting a character literal to `u8` truncates [INFO] [stdout] --> src/lib.rs:226:78 [INFO] [stdout] | [INFO] [stdout] 226 | ... while bytes[first_non_ws_i] == ' ' as u8 || bytes[first_non_ws_i] == '\n' as u8 || bytes[first_non_ws_i] == '\r' as u8 || byt... [INFO] [stdout] | ^^^^^^^^^^ help: use a byte literal instead: `b'\n'` [INFO] [stdout] | [INFO] [stdout] = note: `char` is four bytes wide, but `u8` is a single byte [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#char_lit_as_u8 [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: casting a character literal to `u8` truncates [INFO] [stdout] --> src/lib.rs:226:117 [INFO] [stdout] | [INFO] [stdout] 226 | ...\n' as u8 || bytes[first_non_ws_i] == '\r' as u8 || bytes[first_non_ws_i] == '\t' as u8 { [INFO] [stdout] | ^^^^^^^^^^ help: use a byte literal instead: `b'\r'` [INFO] [stdout] | [INFO] [stdout] = note: `char` is four bytes wide, but `u8` is a single byte [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#char_lit_as_u8 [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: casting a character literal to `u8` truncates [INFO] [stdout] --> src/lib.rs:226:156 [INFO] [stdout] | [INFO] [stdout] 226 | ...\r' as u8 || bytes[first_non_ws_i] == '\t' as u8 { [INFO] [stdout] | ^^^^^^^^^^ help: use a byte literal instead: `b'\t'` [INFO] [stdout] | [INFO] [stdout] = note: `char` is four bytes wide, but `u8` is a single byte [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#char_lit_as_u8 [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: casting a character literal to `u8` truncates [INFO] [stdout] --> src/lib.rs:250:49 [INFO] [stdout] | [INFO] [stdout] 250 | while !(bytes[closing_bracket_i] == '>' as u8 && !inside_a_string){ [INFO] [stdout] | ^^^^^^^^^ help: use a byte literal instead: `b'>'` [INFO] [stdout] | [INFO] [stdout] = note: `char` is four bytes wide, but `u8` is a single byte [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#char_lit_as_u8 [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: casting a character literal to `u8` truncates [INFO] [stdout] --> src/lib.rs:252:68 [INFO] [stdout] | [INFO] [stdout] 252 | if !inside_a_string && bytes[closing_bracket_i] == '<' as u8 { [INFO] [stdout] | ^^^^^^^^^ help: use a byte literal instead: `b'<'` [INFO] [stdout] | [INFO] [stdout] = note: `char` is four bytes wide, but `u8` is a single byte [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#char_lit_as_u8 [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: casting a character literal to `u8` truncates [INFO] [stdout] --> src/lib.rs:258:48 [INFO] [stdout] | [INFO] [stdout] 258 | if bytes[closing_bracket_i] == '"' as u8 { [INFO] [stdout] | ^^^^^^^^^ help: use a byte literal instead: `b'"'` [INFO] [stdout] | [INFO] [stdout] = note: `char` is four bytes wide, but `u8` is a single byte [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#char_lit_as_u8 [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: casting a character literal to `u8` truncates [INFO] [stdout] --> src/lib.rs:274:52 [INFO] [stdout] | [INFO] [stdout] 274 | while bytes[next_opening_bracket_i] != '<' as u8 { [INFO] [stdout] | ^^^^^^^^^ help: use a byte literal instead: `b'<'` [INFO] [stdout] | [INFO] [stdout] = note: `char` is four bytes wide, but `u8` is a single byte [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#char_lit_as_u8 [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this expression creates a reference which is immediately dereferenced by the compiler [INFO] [stdout] --> src/lib.rs:309:55 [INFO] [stdout] | [INFO] [stdout] 309 | Token::OpenTag(ref td) if next_element.closes(&first_element) => { [INFO] [stdout] | ^^^^^^^^^^^^^^ help: change this to: `first_element` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_borrow [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this expression creates a reference which is immediately dereferenced by the compiler [INFO] [stdout] --> src/lib.rs:318:48 [INFO] [stdout] | [INFO] [stdout] 318 | while !tokens[snd_el_index].closes(&first_element) { [INFO] [stdout] | ^^^^^^^^^^^^^^ help: change this to: `first_element` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_borrow [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this expression creates a reference which is immediately dereferenced by the compiler [INFO] [stdout] --> src/lib.rs:329:45 [INFO] [stdout] | [INFO] [stdout] 329 | HtmlNode::El(Element {tag_data: &td, children: children, token_count: tokens_used}) [INFO] [stdout] | ^^^ help: change this to: `td` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_borrow [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this pattern creates a reference to a reference [INFO] [stdout] --> src/lib.rs:303:21 [INFO] [stdout] | [INFO] [stdout] 303 | Token::Text(ref str_data) => { [INFO] [stdout] | ^^^^^^^^^^^^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_borrow [INFO] [stdout] help: try [INFO] [stdout] | [INFO] [stdout] 303 - Token::Text(ref str_data) => { [INFO] [stdout] 303 + Token::Text(str_data) => { [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stderr] Finished `dev` profile [unoptimized + debuginfo] target(s) in 0.60s [INFO] running `Command { std: "docker" "inspect" "d77c72a210325a85ed7fb9fe85e84467884a12b04c11028de58f6fedacebe172", kill_on_drop: false }` [INFO] running `Command { std: "docker" "rm" "-f" "d77c72a210325a85ed7fb9fe85e84467884a12b04c11028de58f6fedacebe172", kill_on_drop: false }` [INFO] [stdout] d77c72a210325a85ed7fb9fe85e84467884a12b04c11028de58f6fedacebe172