[INFO] crate pineapplepizza 0.1.1 is already in cache [INFO] extracting crate pineapplepizza 0.1.1 into work/ex/clippy-test-run/sources/stable/reg/pineapplepizza/0.1.1 [INFO] extracting crate pineapplepizza 0.1.1 into work/ex/clippy-test-run/sources/stable+rustflags=-Dclippy%3A%3Ainto_iter_on_array/reg/pineapplepizza/0.1.1 [INFO] validating manifest of pineapplepizza-0.1.1 on toolchain stable [INFO] running `"/mnt/big/crater/work/local/cargo-home/bin/cargo" "+stable" "read-manifest" "--manifest-path" "Cargo.toml"` [INFO] validating manifest of pineapplepizza-0.1.1 on toolchain stable+rustflags=-Dclippy::into_iter_on_array [INFO] running `"/mnt/big/crater/work/local/cargo-home/bin/cargo" "+stable" "read-manifest" "--manifest-path" "Cargo.toml"` [INFO] started frobbing pineapplepizza-0.1.1 [INFO] finished frobbing pineapplepizza-0.1.1 [INFO] frobbed toml for pineapplepizza-0.1.1 written to work/ex/clippy-test-run/sources/stable/reg/pineapplepizza/0.1.1/Cargo.toml [INFO] started frobbing pineapplepizza-0.1.1 [INFO] finished frobbing pineapplepizza-0.1.1 [INFO] frobbed toml for pineapplepizza-0.1.1 written to work/ex/clippy-test-run/sources/stable+rustflags=-Dclippy%3A%3Ainto_iter_on_array/reg/pineapplepizza/0.1.1/Cargo.toml [INFO] running `"/mnt/big/crater/work/local/cargo-home/bin/cargo" "+stable" "generate-lockfile" "--manifest-path" "Cargo.toml" "-Zno-index-update"` [INFO] running `"/mnt/big/crater/work/local/cargo-home/bin/cargo" "+stable" "generate-lockfile" "--manifest-path" "Cargo.toml" "-Zno-index-update"` [INFO] running `"/mnt/big/crater/work/local/cargo-home/bin/cargo" "+stable" "fetch" "--locked" "--manifest-path" "Cargo.toml"` [INFO] running `"/mnt/big/crater/work/local/cargo-home/bin/cargo" "+stable" "fetch" "--locked" "--manifest-path" "Cargo.toml"` [INFO] linting pineapplepizza-0.1.1 against stable for clippy-test-run [INFO] running `"docker" "create" "-v" "/mnt/big/crater/work/local/target-dirs/clippy-test-run/worker-6/stable:/opt/crater/target:rw,Z" "-v" "/mnt/big/crater/work/ex/clippy-test-run/sources/stable/reg/pineapplepizza/0.1.1:/opt/crater/workdir:ro,Z" "-v" "/mnt/big/crater/work/local/cargo-home:/opt/crater/cargo-home:ro,Z" "-v" "/mnt/big/crater/work/local/rustup-home:/opt/crater/rustup-home:ro,Z" "-e" "USER_ID=1000" "-e" "SOURCE_DIR=/opt/crater/workdir" "-e" "MAP_USER_ID=1000" "-e" "CARGO_TARGET_DIR=/opt/crater/target" "-e" "CARGO_INCREMENTAL=0" "-e" "RUST_BACKTRACE=full" "-e" "RUSTFLAGS=--cap-lints=forbid" "-e" "CARGO_HOME=/opt/crater/cargo-home" "-e" "RUSTUP_HOME=/opt/crater/rustup-home" "-w" "/opt/crater/workdir" "-m" "1536M" "--network" "none" "rustops/crates-build-env" "/opt/crater/cargo-home/bin/cargo" "+stable" "clippy" "--frozen" "--all" "--all-targets"` [INFO] [stdout] 4bd4555a4d093fb4882f4d723ea751c9097ef460f162c5e6648fd5665356ef9e [INFO] running `"docker" "start" "-a" "4bd4555a4d093fb4882f4d723ea751c9097ef460f162c5e6648fd5665356ef9e"` [INFO] [stderr] Checking nom v4.1.1 [INFO] [stderr] Checking pineapplepizza v0.1.1 (/opt/crater/workdir) [INFO] [stderr] warning: unused import: `std::option` [INFO] [stderr] --> src/main.rs:12:5 [INFO] [stderr] | [INFO] [stderr] 12 | use std::option; [INFO] [stderr] | ^^^^^^^^^^^ [INFO] [stderr] | [INFO] [stderr] = note: #[warn(unused_imports)] on by default [INFO] [stderr] [INFO] [stderr] warning: unused import: `nom::ErrorKind::Custom` [INFO] [stderr] --> src/main.rs:20:5 [INFO] [stderr] | [INFO] [stderr] 20 | use nom::ErrorKind::Custom; [INFO] [stderr] | ^^^^^^^^^^^^^^^^^^^^^^ [INFO] [stderr] [INFO] [stderr] warning: unused imports: `SerializeMap`, `SerializeSeq` [INFO] [stderr] --> src/main.rs:21:41 [INFO] [stderr] | [INFO] [stderr] 21 | use serde::ser::{Serialize, Serializer, SerializeSeq, SerializeMap}; [INFO] [stderr] | ^^^^^^^^^^^^ ^^^^^^^^^^^^ [INFO] [stderr] [INFO] [stderr] warning: unnecessary parentheses around assigned value [INFO] [stderr] --> src/main.rs:114:15 [INFO] [stderr] | [INFO] [stderr] 114 | let sep = (if sepb {"- "} else {"* "}); [INFO] [stderr] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: remove these parentheses [INFO] [stderr] | [INFO] [stderr] = note: #[warn(unused_parens)] on by default [INFO] [stderr] [INFO] [stderr] warning: unnecessary parentheses around `if` condition [INFO] [stderr] --> src/main.rs:153:5 [INFO] [stderr] | [INFO] [stderr] 153 | if(level == 0) { [INFO] [stderr] | ^^^^^^^^^^^^ help: remove these parentheses [INFO] [stderr] [INFO] [stderr] warning: unnecessary parentheses around `if` condition [INFO] [stderr] --> src/main.rs:199:6 [INFO] [stderr] | [INFO] [stderr] 199 | if (args.len() < 3) { [INFO] [stderr] | ^^^^^^^^^^^^^^^^ help: remove these parentheses [INFO] [stderr] [INFO] [stderr] warning: unnecessary parentheses around assigned value [INFO] [stderr] --> src/main.rs:206:19 [INFO] [stderr] | [INFO] [stderr] 206 | let print_out = (args.len() == 3); [INFO] [stderr] | ^^^^^^^^^^^^^^^^^ help: remove these parentheses [INFO] [stderr] [INFO] [stderr] warning: unused import: `std::option` [INFO] [stderr] --> src/main.rs:12:5 [INFO] [stderr] | [INFO] [stderr] 12 | use std::option; [INFO] [stderr] | ^^^^^^^^^^^ [INFO] [stderr] | [INFO] [stderr] = note: #[warn(unused_imports)] on by default [INFO] [stderr] [INFO] [stderr] warning: unused import: `nom::ErrorKind::Custom` [INFO] [stderr] --> src/main.rs:20:5 [INFO] [stderr] | [INFO] [stderr] 20 | use nom::ErrorKind::Custom; [INFO] [stderr] | ^^^^^^^^^^^^^^^^^^^^^^ [INFO] [stderr] [INFO] [stderr] warning: unused imports: `SerializeMap`, `SerializeSeq` [INFO] [stderr] --> src/main.rs:21:41 [INFO] [stderr] | [INFO] [stderr] 21 | use serde::ser::{Serialize, Serializer, SerializeSeq, SerializeMap}; [INFO] [stderr] | ^^^^^^^^^^^^ ^^^^^^^^^^^^ [INFO] [stderr] [INFO] [stderr] warning: unnecessary parentheses around assigned value [INFO] [stderr] --> src/main.rs:114:15 [INFO] [stderr] | [INFO] [stderr] 114 | let sep = (if sepb {"- "} else {"* "}); [INFO] [stderr] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: remove these parentheses [INFO] [stderr] | [INFO] [stderr] = note: #[warn(unused_parens)] on by default [INFO] [stderr] [INFO] [stderr] warning: unnecessary parentheses around `if` condition [INFO] [stderr] --> src/main.rs:153:5 [INFO] [stderr] | [INFO] [stderr] 153 | if(level == 0) { [INFO] [stderr] | ^^^^^^^^^^^^ help: remove these parentheses [INFO] [stderr] [INFO] [stderr] warning: unnecessary parentheses around `if` condition [INFO] [stderr] --> src/main.rs:199:6 [INFO] [stderr] | [INFO] [stderr] 199 | if (args.len() < 3) { [INFO] [stderr] | ^^^^^^^^^^^^^^^^ help: remove these parentheses [INFO] [stderr] [INFO] [stderr] warning: unnecessary parentheses around assigned value [INFO] [stderr] --> src/main.rs:206:19 [INFO] [stderr] | [INFO] [stderr] 206 | let print_out = (args.len() == 3); [INFO] [stderr] | ^^^^^^^^^^^^^^^^^ help: remove these parentheses [INFO] [stderr] [INFO] [stderr] warning: unused variable: `num` [INFO] [stderr] --> src/main.rs:130:9 [INFO] [stderr] | [INFO] [stderr] 130 | num: call!(nom::digit) >> // Eventually, validate using this [INFO] [stderr] | ^^^ help: consider using `_num` instead [INFO] [stderr] | [INFO] [stderr] = note: #[warn(unused_variables)] on by default [INFO] [stderr] [INFO] [stderr] warning: unused variable: `num` [INFO] [stderr] --> src/main.rs:130:9 [INFO] [stderr] | [INFO] [stderr] 130 | num: call!(nom::digit) >> // Eventually, validate using this [INFO] [stderr] | ^^^ help: consider using `_num` instead [INFO] [stderr] [INFO] [stderr] warning: unused variable: `len` [INFO] [stderr] --> src/main.rs:156:362 [INFO] [stderr] | [INFO] [stderr] 156 | map!(verify!(do_parse!(name: take_till!(|ch| ch == '\n') >> tag!("\n") >> underscore: take_while!(|c| c == '=') >> tag!("\n\n") >> (name, underscore)), |(txt, underscore): (&str, &str)| UnicodeSegmentation::graphemes(txt, true).collect::>().len() == UnicodeSegmentation::graphemes(underscore, true).collect::>().len()), |(txt, len)| txt)); [INFO] [stderr] | ^^^ help: consider using `_len` instead [INFO] [stderr] [INFO] [stderr] warning: length comparison to zero [INFO] [stderr] --> src/main.rs:69:6 [INFO] [stderr] | [INFO] [stderr] 69 | if ul.len() == 0 { [INFO] [stderr] | ^^^^^^^^^^^^^ help: using `is_empty` is clearer and more explicit: `ul.is_empty()` [INFO] [stderr] | [INFO] [stderr] = note: #[warn(clippy::len_zero)] on by default [INFO] [stderr] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#len_zero [INFO] [stderr] [INFO] [stderr] warning: length comparison to zero [INFO] [stderr] --> src/main.rs:80:6 [INFO] [stderr] | [INFO] [stderr] 80 | if ol.len() == 0 { [INFO] [stderr] | ^^^^^^^^^^^^^ help: using `is_empty` is clearer and more explicit: `ol.is_empty()` [INFO] [stderr] | [INFO] [stderr] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#len_zero [INFO] [stderr] [INFO] [stderr] warning: use of a blacklisted/placeholder name `foo` [INFO] [stderr] --> src/main.rs:93:9 [INFO] [stderr] | [INFO] [stderr] 93 | let foo = format!("\n\n{}\n\n\n", node.name); [INFO] [stderr] | ^^^ [INFO] [stderr] | [INFO] [stderr] = note: #[warn(clippy::blacklisted_name)] on by default [INFO] [stderr] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#blacklisted_name [INFO] [stderr] [INFO] [stderr] warning: use of a blacklisted/placeholder name `foo` [INFO] [stderr] --> src/main.rs:96:9 [INFO] [stderr] | [INFO] [stderr] 96 | let foo = format!("{}\n", node.level, node.name, node.level); [INFO] [stderr] | ^^^ [INFO] [stderr] | [INFO] [stderr] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#blacklisted_name [INFO] [stderr] [INFO] [stderr] error: for loop over `node.text.clone()`, which is an `Option`. This is more readably written as an `if let` statement. [INFO] [stderr] --> src/main.rs:99:14 [INFO] [stderr] | [INFO] [stderr] 99 | for txt in node.text.clone() { [INFO] [stderr] | ^^^^^^^^^^^^^^^^^ [INFO] [stderr] | [INFO] [stderr] = note: #[deny(clippy::for_loop_over_option)] on by default [INFO] [stderr] = help: consider replacing `for txt in node.text.clone()` with `if let Some(txt) = node.text.clone()` [INFO] [stderr] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#for_loop_over_option [INFO] [stderr] [INFO] [stderr] warning: the function has a cyclomatic complexity of 39 [INFO] [stderr] --> src/main.rs:113:1 [INFO] [stderr] | [INFO] [stderr] 113 | / fn ul_wrapper<'a>(input: &'a str, sepb: bool) -> IResult<&'a str, Vec>> { [INFO] [stderr] 114 | | let sep = (if sepb {"- "} else {"* "}); [INFO] [stderr] 115 | | do_parse!(input, [INFO] [stderr] 116 | | it: many1!(do_parse!( [INFO] [stderr] ... | [INFO] [stderr] 124 | | ) [INFO] [stderr] 125 | | } [INFO] [stderr] | |_^ [INFO] [stderr] | [INFO] [stderr] = note: #[warn(clippy::cyclomatic_complexity)] on by default [INFO] [stderr] = help: you could split it up into multiple smaller functions [INFO] [stderr] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#cyclomatic_complexity [INFO] [stderr] [INFO] [stderr] warning: redundant closure found [INFO] [stderr] --> src/main.rs:115:5 [INFO] [stderr] | [INFO] [stderr] 115 | / do_parse!(input, [INFO] [stderr] 116 | | it: many1!(do_parse!( [INFO] [stderr] 117 | | tag!(sep) >> [INFO] [stderr] 118 | | name: take_till!(|ch| ch == '\n') >> [INFO] [stderr] ... | [INFO] [stderr] 123 | | )) >> tag!("\n") >> (it) [INFO] [stderr] 124 | | ) [INFO] [stderr] | |_____^ [INFO] [stderr] | [INFO] [stderr] = note: #[warn(clippy::redundant_closure)] on by default [INFO] [stderr] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#redundant_closure [INFO] [stderr] = note: this error originates in a macro outside of the current crate (in Nightly builds, run with -Z external-macro-backtrace for more info) [INFO] [stderr] [INFO] [stderr] warning: redundant closure found [INFO] [stderr] --> src/main.rs:115:5 [INFO] [stderr] | [INFO] [stderr] 115 | / do_parse!(input, [INFO] [stderr] 116 | | it: many1!(do_parse!( [INFO] [stderr] 117 | | tag!(sep) >> [INFO] [stderr] 118 | | name: take_till!(|ch| ch == '\n') >> [INFO] [stderr] ... | [INFO] [stderr] 123 | | )) >> tag!("\n") >> (it) [INFO] [stderr] 124 | | ) [INFO] [stderr] | |_____^ [INFO] [stderr] | [INFO] [stderr] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#redundant_closure [INFO] [stderr] = note: this error originates in a macro outside of the current crate (in Nightly builds, run with -Z external-macro-backtrace for more info) [INFO] [stderr] [INFO] [stderr] warning: redundant closure found [INFO] [stderr] --> src/main.rs:115:5 [INFO] [stderr] | [INFO] [stderr] 115 | / do_parse!(input, [INFO] [stderr] 116 | | it: many1!(do_parse!( [INFO] [stderr] 117 | | tag!(sep) >> [INFO] [stderr] 118 | | name: take_till!(|ch| ch == '\n') >> [INFO] [stderr] ... | [INFO] [stderr] 123 | | )) >> tag!("\n") >> (it) [INFO] [stderr] 124 | | ) [INFO] [stderr] | |_____^ [INFO] [stderr] | [INFO] [stderr] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#redundant_closure [INFO] [stderr] = note: this error originates in a macro outside of the current crate (in Nightly builds, run with -Z external-macro-backtrace for more info) [INFO] [stderr] [INFO] [stderr] warning: redundant closure found [INFO] [stderr] --> src/main.rs:115:5 [INFO] [stderr] | [INFO] [stderr] 115 | / do_parse!(input, [INFO] [stderr] 116 | | it: many1!(do_parse!( [INFO] [stderr] 117 | | tag!(sep) >> [INFO] [stderr] 118 | | name: take_till!(|ch| ch == '\n') >> [INFO] [stderr] ... | [INFO] [stderr] 123 | | )) >> tag!("\n") >> (it) [INFO] [stderr] 124 | | ) [INFO] [stderr] | |_____^ [INFO] [stderr] | [INFO] [stderr] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#redundant_closure [INFO] [stderr] = note: this error originates in a macro outside of the current crate (in Nightly builds, run with -Z external-macro-backtrace for more info) [INFO] [stderr] [INFO] [stderr] warning: redundant closure found [INFO] [stderr] --> src/main.rs:115:5 [INFO] [stderr] | [INFO] [stderr] 115 | / do_parse!(input, [INFO] [stderr] 116 | | it: many1!(do_parse!( [INFO] [stderr] 117 | | tag!(sep) >> [INFO] [stderr] 118 | | name: take_till!(|ch| ch == '\n') >> [INFO] [stderr] ... | [INFO] [stderr] 123 | | )) >> tag!("\n") >> (it) [INFO] [stderr] 124 | | ) [INFO] [stderr] | |_____^ [INFO] [stderr] | [INFO] [stderr] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#redundant_closure [INFO] [stderr] = note: this error originates in a macro outside of the current crate (in Nightly builds, run with -Z external-macro-backtrace for more info) [INFO] [stderr] [INFO] [stderr] warning: redundant closure found [INFO] [stderr] --> src/main.rs:115:5 [INFO] [stderr] | [INFO] [stderr] 115 | / do_parse!(input, [INFO] [stderr] 116 | | it: many1!(do_parse!( [INFO] [stderr] 117 | | tag!(sep) >> [INFO] [stderr] 118 | | name: take_till!(|ch| ch == '\n') >> [INFO] [stderr] ... | [INFO] [stderr] 123 | | )) >> tag!("\n") >> (it) [INFO] [stderr] 124 | | ) [INFO] [stderr] | |_____^ [INFO] [stderr] | [INFO] [stderr] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#redundant_closure [INFO] [stderr] = note: this error originates in a macro outside of the current crate (in Nightly builds, run with -Z external-macro-backtrace for more info) [INFO] [stderr] [INFO] [stderr] warning: redundant closure found [INFO] [stderr] --> src/main.rs:128:5 [INFO] [stderr] | [INFO] [stderr] 128 | / do_parse!(input, [INFO] [stderr] 129 | | it: many1!(do_parse!( [INFO] [stderr] 130 | | num: call!(nom::digit) >> // Eventually, validate using this [INFO] [stderr] 131 | | tag!(". ") >> [INFO] [stderr] ... | [INFO] [stderr] 135 | | )) >> tag!("\n") >> (it) [INFO] [stderr] 136 | | ) [INFO] [stderr] | |_____^ [INFO] [stderr] | [INFO] [stderr] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#redundant_closure [INFO] [stderr] = note: this error originates in a macro outside of the current crate (in Nightly builds, run with -Z external-macro-backtrace for more info) [INFO] [stderr] [INFO] [stderr] warning: redundant closure found [INFO] [stderr] --> src/main.rs:128:5 [INFO] [stderr] | [INFO] [stderr] 128 | / do_parse!(input, [INFO] [stderr] 129 | | it: many1!(do_parse!( [INFO] [stderr] 130 | | num: call!(nom::digit) >> // Eventually, validate using this [INFO] [stderr] 131 | | tag!(". ") >> [INFO] [stderr] ... | [INFO] [stderr] 135 | | )) >> tag!("\n") >> (it) [INFO] [stderr] 136 | | ) [INFO] [stderr] | |_____^ [INFO] [stderr] | [INFO] [stderr] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#redundant_closure [INFO] [stderr] = note: this error originates in a macro outside of the current crate (in Nightly builds, run with -Z external-macro-backtrace for more info) [INFO] [stderr] [INFO] [stderr] warning: the function has a cyclomatic complexity of 31 [INFO] [stderr] --> src/main.rs:152:1 [INFO] [stderr] | [INFO] [stderr] 152 | / fn h_wrapper<'a>(input: &'a str, level: u8) -> IResult<&'a str, StructuredCollection> { [INFO] [stderr] 153 | | if(level == 0) { [INFO] [stderr] 154 | | let x = alt!(input, [INFO] [stderr] 155 | | do_parse!(tag!("# ") >> name: take_till!(|ch| ch == '\n') >> tag!("\n\n") >> (name)) | [INFO] [stderr] ... | [INFO] [stderr] 168 | | } [INFO] [stderr] 169 | | } [INFO] [stderr] | |_^ [INFO] [stderr] | [INFO] [stderr] = help: you could split it up into multiple smaller functions [INFO] [stderr] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#cyclomatic_complexity [INFO] [stderr] [INFO] [stderr] warning: redundant closure found [INFO] [stderr] --> src/main.rs:154:13 [INFO] [stderr] | [INFO] [stderr] 154 | let x = alt!(input, [INFO] [stderr] | _____________^ [INFO] [stderr] 155 | | do_parse!(tag!("# ") >> name: take_till!(|ch| ch == '\n') >> tag!("\n\n") >> (name)) | [INFO] [stderr] 156 | | map!(verify!(do_parse!(name: take_till!(|ch| ch == '\n') >> tag!("\n") >> underscore: take_while!(|c| c == '=') >> tag!("\n\n") >> (name, underscore)), |(txt, underscore): (&str, &str)| UnicodeSegmentation::graphemes(txt, true).collect::>().len() == UnicodeSegmentation::graphemes(underscore, true).collect::>().len()), |(txt, len)| txt)); [INFO] [stderr] | |____________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________^ [INFO] [stderr] | [INFO] [stderr] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#redundant_closure [INFO] [stderr] = note: this error originates in a macro outside of the current crate (in Nightly builds, run with -Z external-macro-backtrace for more info) [INFO] [stderr] [INFO] [stderr] warning: redundant closure found [INFO] [stderr] --> src/main.rs:154:13 [INFO] [stderr] | [INFO] [stderr] 154 | let x = alt!(input, [INFO] [stderr] | _____________^ [INFO] [stderr] 155 | | do_parse!(tag!("# ") >> name: take_till!(|ch| ch == '\n') >> tag!("\n\n") >> (name)) | [INFO] [stderr] 156 | | map!(verify!(do_parse!(name: take_till!(|ch| ch == '\n') >> tag!("\n") >> underscore: take_while!(|c| c == '=') >> tag!("\n\n") >> (name, underscore)), |(txt, underscore): (&str, &str)| UnicodeSegmentation::graphemes(txt, true).collect::>().len() == UnicodeSegmentation::graphemes(underscore, true).collect::>().len()), |(txt, len)| txt)); [INFO] [stderr] | |____________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________^ [INFO] [stderr] | [INFO] [stderr] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#redundant_closure [INFO] [stderr] = note: this error originates in a macro outside of the current crate (in Nightly builds, run with -Z external-macro-backtrace for more info) [INFO] [stderr] [INFO] [stderr] warning: avoid using `collect()` when not needed [INFO] [stderr] --> src/main.rs:156:242 [INFO] [stderr] | [INFO] [stderr] 156 | map!(verify!(do_parse!(name: take_till!(|ch| ch == '\n') >> tag!("\n") >> underscore: take_while!(|c| c == '=') >> tag!("\n\n") >> (name, underscore)), |(txt, underscore): (&str, &str)| UnicodeSegmentation::graphemes(txt, true).collect::>().len() == UnicodeSegmentation::graphemes(underscore, true).collect::>().len()), |(txt, len)| txt)); [INFO] [stderr] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: replace with: `.count()` [INFO] [stderr] | [INFO] [stderr] = note: #[warn(clippy::needless_collect)] on by default [INFO] [stderr] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_collect [INFO] [stderr] [INFO] [stderr] warning: avoid using `collect()` when not needed [INFO] [stderr] --> src/main.rs:156:323 [INFO] [stderr] | [INFO] [stderr] 156 | map!(verify!(do_parse!(name: take_till!(|ch| ch == '\n') >> tag!("\n") >> underscore: take_while!(|c| c == '=') >> tag!("\n\n") >> (name, underscore)), |(txt, underscore): (&str, &str)| UnicodeSegmentation::graphemes(txt, true).collect::>().len() == UnicodeSegmentation::graphemes(underscore, true).collect::>().len()), |(txt, len)| txt)); [INFO] [stderr] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: replace with: `.count()` [INFO] [stderr] | [INFO] [stderr] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_collect [INFO] [stderr] [INFO] [stderr] warning: redundant closure found [INFO] [stderr] --> src/main.rs:163:13 [INFO] [stderr] | [INFO] [stderr] 163 | let x = do_parse!(input, tag!(hashes) >> many0!(tag!(" ")) >> name: take_till!(|ch| ch == '\n') >> tag!("\n") >> (name)); [INFO] [stderr] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ [INFO] [stderr] | [INFO] [stderr] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#redundant_closure [INFO] [stderr] = note: this error originates in a macro outside of the current crate (in Nightly builds, run with -Z external-macro-backtrace for more info) [INFO] [stderr] [INFO] [stderr] warning: the function has a cyclomatic complexity of 41 [INFO] [stderr] --> src/main.rs:170:1 [INFO] [stderr] | [INFO] [stderr] 170 | / fn h_sub_wrapper<'a>(input: &'a str, level: u8, name: &'a str) -> IResult<&'a str, StructuredCollection<'a>> { [INFO] [stderr] 171 | | do_parse!(input, [INFO] [stderr] 172 | | // Assume that something is text until we hit a start token for anything else [INFO] [stderr] 173 | | text: many0!(do_parse!( [INFO] [stderr] ... | [INFO] [stderr] 190 | | ) [INFO] [stderr] 191 | | } [INFO] [stderr] | |_^ [INFO] [stderr] | [INFO] [stderr] = help: you could split it up into multiple smaller functions [INFO] [stderr] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#cyclomatic_complexity [INFO] [stderr] [INFO] [stderr] warning: redundant closure found [INFO] [stderr] --> src/main.rs:171:3 [INFO] [stderr] | [INFO] [stderr] 171 | / do_parse!(input, [INFO] [stderr] 172 | | // Assume that something is text until we hit a start token for anything else [INFO] [stderr] 173 | | text: many0!(do_parse!( [INFO] [stderr] 174 | | // Check against start tokens - TODO: be more thorough about this [INFO] [stderr] ... | [INFO] [stderr] 189 | | }) [INFO] [stderr] 190 | | ) [INFO] [stderr] | |___^ [INFO] [stderr] | [INFO] [stderr] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#redundant_closure [INFO] [stderr] = note: this error originates in a macro outside of the current crate (in Nightly builds, run with -Z external-macro-backtrace for more info) [INFO] [stderr] [INFO] [stderr] warning: length comparison to zero [INFO] [stderr] --> src/main.rs:185:17 [INFO] [stderr] | [INFO] [stderr] 185 | text: (if text.len() == 0 || (text.len() == 1 && text[0] == "") { None } else { Some(text.iter().fold(String::new(), |acc, x| acc + &format!("{}\n", x)).clone()) }), [INFO] [stderr] | ^^^^^^^^^^^^^^^ help: using `is_empty` is clearer and more explicit: `text.is_empty()` [INFO] [stderr] | [INFO] [stderr] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#len_zero [INFO] [stderr] [INFO] [stderr] warning: you seem to be trying to use match for destructuring a single pattern. Consider using `if let` [INFO] [stderr] --> src/main.rs:217:3 [INFO] [stderr] | [INFO] [stderr] 217 | / match file.read_to_string(&mut s) { [INFO] [stderr] 218 | | Err(why) => panic!("couldn't read {}: {}", &input_file, [INFO] [stderr] 219 | | why.description()), [INFO] [stderr] 220 | | _ => () [INFO] [stderr] 221 | | } [INFO] [stderr] | |___^ [INFO] [stderr] | [INFO] [stderr] = note: #[warn(clippy::single_match)] on by default [INFO] [stderr] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#single_match [INFO] [stderr] help: try this [INFO] [stderr] | [INFO] [stderr] 217 | if let Err(why) = file.read_to_string(&mut s) { panic!("couldn't read {}: {}", &input_file, [INFO] [stderr] 218 | why.description()) } [INFO] [stderr] | [INFO] [stderr] [INFO] [stderr] warning: use of a blacklisted/placeholder name `foo` [INFO] [stderr] --> src/main.rs:222:7 [INFO] [stderr] | [INFO] [stderr] 222 | let foo = s.clone(); [INFO] [stderr] | ^^^ [INFO] [stderr] | [INFO] [stderr] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#blacklisted_name [INFO] [stderr] [INFO] [stderr] warning: useless use of `format!` [INFO] [stderr] --> src/main.rs:229:23 [INFO] [stderr] | [INFO] [stderr] 229 | "--html" => format!("{}", all_to_html(&doc)), [INFO] [stderr] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: consider using .to_string(): `all_to_html(&doc).to_string()` [INFO] [stderr] | [INFO] [stderr] = note: #[warn(clippy::useless_format)] on by default [INFO] [stderr] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#useless_format [INFO] [stderr] = note: this error originates in a macro outside of the current crate (in Nightly builds, run with -Z external-macro-backtrace for more info) [INFO] [stderr] [INFO] [stderr] warning: useless use of `format!` [INFO] [stderr] --> src/main.rs:231:17 [INFO] [stderr] | [INFO] [stderr] 231 | Ok(x) => format!("{}", x), [INFO] [stderr] | ^^^^^^^^^^^^^^^^ help: consider using .to_string(): `x.to_string()` [INFO] [stderr] | [INFO] [stderr] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#useless_format [INFO] [stderr] = note: this error originates in a macro outside of the current crate (in Nightly builds, run with -Z external-macro-backtrace for more info) [INFO] [stderr] [INFO] [stderr] error: aborting due to previous error [INFO] [stderr] [INFO] [stderr] error: Could not compile `pineapplepizza`. [INFO] [stderr] warning: build failed, waiting for other jobs to finish... [INFO] [stderr] warning: unused variable: `num` [INFO] [stderr] --> src/main.rs:130:9 [INFO] [stderr] | [INFO] [stderr] 130 | num: call!(nom::digit) >> // Eventually, validate using this [INFO] [stderr] | ^^^ help: consider using `_num` instead [INFO] [stderr] | [INFO] [stderr] = note: #[warn(unused_variables)] on by default [INFO] [stderr] [INFO] [stderr] warning: unused variable: `num` [INFO] [stderr] --> src/main.rs:130:9 [INFO] [stderr] | [INFO] [stderr] 130 | num: call!(nom::digit) >> // Eventually, validate using this [INFO] [stderr] | ^^^ help: consider using `_num` instead [INFO] [stderr] [INFO] [stderr] warning: unused variable: `len` [INFO] [stderr] --> src/main.rs:156:362 [INFO] [stderr] | [INFO] [stderr] 156 | map!(verify!(do_parse!(name: take_till!(|ch| ch == '\n') >> tag!("\n") >> underscore: take_while!(|c| c == '=') >> tag!("\n\n") >> (name, underscore)), |(txt, underscore): (&str, &str)| UnicodeSegmentation::graphemes(txt, true).collect::>().len() == UnicodeSegmentation::graphemes(underscore, true).collect::>().len()), |(txt, len)| txt)); [INFO] [stderr] | ^^^ help: consider using `_len` instead [INFO] [stderr] [INFO] [stderr] warning: unused variable: `s` [INFO] [stderr] --> src/main.rs:299:13 [INFO] [stderr] | [INFO] [stderr] 299 | let mut s = String::new(); [INFO] [stderr] | ^ help: consider using `_s` instead [INFO] [stderr] [INFO] [stderr] warning: length comparison to zero [INFO] [stderr] --> src/main.rs:69:6 [INFO] [stderr] | [INFO] [stderr] 69 | if ul.len() == 0 { [INFO] [stderr] | ^^^^^^^^^^^^^ help: using `is_empty` is clearer and more explicit: `ul.is_empty()` [INFO] [stderr] | [INFO] [stderr] = note: #[warn(clippy::len_zero)] on by default [INFO] [stderr] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#len_zero [INFO] [stderr] [INFO] [stderr] warning: length comparison to zero [INFO] [stderr] --> src/main.rs:80:6 [INFO] [stderr] | [INFO] [stderr] 80 | if ol.len() == 0 { [INFO] [stderr] | ^^^^^^^^^^^^^ help: using `is_empty` is clearer and more explicit: `ol.is_empty()` [INFO] [stderr] | [INFO] [stderr] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#len_zero [INFO] [stderr] [INFO] [stderr] warning: use of a blacklisted/placeholder name `foo` [INFO] [stderr] --> src/main.rs:93:9 [INFO] [stderr] | [INFO] [stderr] 93 | let foo = format!("\n\n{}\n\n\n", node.name); [INFO] [stderr] | ^^^ [INFO] [stderr] | [INFO] [stderr] = note: #[warn(clippy::blacklisted_name)] on by default [INFO] [stderr] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#blacklisted_name [INFO] [stderr] [INFO] [stderr] warning: use of a blacklisted/placeholder name `foo` [INFO] [stderr] --> src/main.rs:96:9 [INFO] [stderr] | [INFO] [stderr] 96 | let foo = format!("{}\n", node.level, node.name, node.level); [INFO] [stderr] | ^^^ [INFO] [stderr] | [INFO] [stderr] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#blacklisted_name [INFO] [stderr] [INFO] [stderr] error: for loop over `node.text.clone()`, which is an `Option`. This is more readably written as an `if let` statement. [INFO] [stderr] --> src/main.rs:99:14 [INFO] [stderr] | [INFO] [stderr] 99 | for txt in node.text.clone() { [INFO] [stderr] | ^^^^^^^^^^^^^^^^^ [INFO] [stderr] | [INFO] [stderr] = note: #[deny(clippy::for_loop_over_option)] on by default [INFO] [stderr] = help: consider replacing `for txt in node.text.clone()` with `if let Some(txt) = node.text.clone()` [INFO] [stderr] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#for_loop_over_option [INFO] [stderr] [INFO] [stderr] warning: the function has a cyclomatic complexity of 39 [INFO] [stderr] --> src/main.rs:113:1 [INFO] [stderr] | [INFO] [stderr] 113 | / fn ul_wrapper<'a>(input: &'a str, sepb: bool) -> IResult<&'a str, Vec>> { [INFO] [stderr] 114 | | let sep = (if sepb {"- "} else {"* "}); [INFO] [stderr] 115 | | do_parse!(input, [INFO] [stderr] 116 | | it: many1!(do_parse!( [INFO] [stderr] ... | [INFO] [stderr] 124 | | ) [INFO] [stderr] 125 | | } [INFO] [stderr] | |_^ [INFO] [stderr] | [INFO] [stderr] = note: #[warn(clippy::cyclomatic_complexity)] on by default [INFO] [stderr] = help: you could split it up into multiple smaller functions [INFO] [stderr] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#cyclomatic_complexity [INFO] [stderr] [INFO] [stderr] warning: redundant closure found [INFO] [stderr] --> src/main.rs:115:5 [INFO] [stderr] | [INFO] [stderr] 115 | / do_parse!(input, [INFO] [stderr] 116 | | it: many1!(do_parse!( [INFO] [stderr] 117 | | tag!(sep) >> [INFO] [stderr] 118 | | name: take_till!(|ch| ch == '\n') >> [INFO] [stderr] ... | [INFO] [stderr] 123 | | )) >> tag!("\n") >> (it) [INFO] [stderr] 124 | | ) [INFO] [stderr] | |_____^ [INFO] [stderr] | [INFO] [stderr] = note: #[warn(clippy::redundant_closure)] on by default [INFO] [stderr] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#redundant_closure [INFO] [stderr] = note: this error originates in a macro outside of the current crate (in Nightly builds, run with -Z external-macro-backtrace for more info) [INFO] [stderr] [INFO] [stderr] warning: redundant closure found [INFO] [stderr] --> src/main.rs:115:5 [INFO] [stderr] | [INFO] [stderr] 115 | / do_parse!(input, [INFO] [stderr] 116 | | it: many1!(do_parse!( [INFO] [stderr] 117 | | tag!(sep) >> [INFO] [stderr] 118 | | name: take_till!(|ch| ch == '\n') >> [INFO] [stderr] ... | [INFO] [stderr] 123 | | )) >> tag!("\n") >> (it) [INFO] [stderr] 124 | | ) [INFO] [stderr] | |_____^ [INFO] [stderr] | [INFO] [stderr] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#redundant_closure [INFO] [stderr] = note: this error originates in a macro outside of the current crate (in Nightly builds, run with -Z external-macro-backtrace for more info) [INFO] [stderr] [INFO] [stderr] warning: redundant closure found [INFO] [stderr] --> src/main.rs:115:5 [INFO] [stderr] | [INFO] [stderr] 115 | / do_parse!(input, [INFO] [stderr] 116 | | it: many1!(do_parse!( [INFO] [stderr] 117 | | tag!(sep) >> [INFO] [stderr] 118 | | name: take_till!(|ch| ch == '\n') >> [INFO] [stderr] ... | [INFO] [stderr] 123 | | )) >> tag!("\n") >> (it) [INFO] [stderr] 124 | | ) [INFO] [stderr] | |_____^ [INFO] [stderr] | [INFO] [stderr] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#redundant_closure [INFO] [stderr] = note: this error originates in a macro outside of the current crate (in Nightly builds, run with -Z external-macro-backtrace for more info) [INFO] [stderr] [INFO] [stderr] warning: redundant closure found [INFO] [stderr] --> src/main.rs:115:5 [INFO] [stderr] | [INFO] [stderr] 115 | / do_parse!(input, [INFO] [stderr] 116 | | it: many1!(do_parse!( [INFO] [stderr] 117 | | tag!(sep) >> [INFO] [stderr] 118 | | name: take_till!(|ch| ch == '\n') >> [INFO] [stderr] ... | [INFO] [stderr] 123 | | )) >> tag!("\n") >> (it) [INFO] [stderr] 124 | | ) [INFO] [stderr] | |_____^ [INFO] [stderr] | [INFO] [stderr] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#redundant_closure [INFO] [stderr] = note: this error originates in a macro outside of the current crate (in Nightly builds, run with -Z external-macro-backtrace for more info) [INFO] [stderr] [INFO] [stderr] warning: redundant closure found [INFO] [stderr] --> src/main.rs:115:5 [INFO] [stderr] | [INFO] [stderr] 115 | / do_parse!(input, [INFO] [stderr] 116 | | it: many1!(do_parse!( [INFO] [stderr] 117 | | tag!(sep) >> [INFO] [stderr] 118 | | name: take_till!(|ch| ch == '\n') >> [INFO] [stderr] ... | [INFO] [stderr] 123 | | )) >> tag!("\n") >> (it) [INFO] [stderr] 124 | | ) [INFO] [stderr] | |_____^ [INFO] [stderr] | [INFO] [stderr] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#redundant_closure [INFO] [stderr] = note: this error originates in a macro outside of the current crate (in Nightly builds, run with -Z external-macro-backtrace for more info) [INFO] [stderr] [INFO] [stderr] warning: redundant closure found [INFO] [stderr] --> src/main.rs:115:5 [INFO] [stderr] | [INFO] [stderr] 115 | / do_parse!(input, [INFO] [stderr] 116 | | it: many1!(do_parse!( [INFO] [stderr] 117 | | tag!(sep) >> [INFO] [stderr] 118 | | name: take_till!(|ch| ch == '\n') >> [INFO] [stderr] ... | [INFO] [stderr] 123 | | )) >> tag!("\n") >> (it) [INFO] [stderr] 124 | | ) [INFO] [stderr] | |_____^ [INFO] [stderr] | [INFO] [stderr] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#redundant_closure [INFO] [stderr] = note: this error originates in a macro outside of the current crate (in Nightly builds, run with -Z external-macro-backtrace for more info) [INFO] [stderr] [INFO] [stderr] warning: redundant closure found [INFO] [stderr] --> src/main.rs:128:5 [INFO] [stderr] | [INFO] [stderr] 128 | / do_parse!(input, [INFO] [stderr] 129 | | it: many1!(do_parse!( [INFO] [stderr] 130 | | num: call!(nom::digit) >> // Eventually, validate using this [INFO] [stderr] 131 | | tag!(". ") >> [INFO] [stderr] ... | [INFO] [stderr] 135 | | )) >> tag!("\n") >> (it) [INFO] [stderr] 136 | | ) [INFO] [stderr] | |_____^ [INFO] [stderr] | [INFO] [stderr] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#redundant_closure [INFO] [stderr] = note: this error originates in a macro outside of the current crate (in Nightly builds, run with -Z external-macro-backtrace for more info) [INFO] [stderr] [INFO] [stderr] warning: redundant closure found [INFO] [stderr] --> src/main.rs:128:5 [INFO] [stderr] | [INFO] [stderr] 128 | / do_parse!(input, [INFO] [stderr] 129 | | it: many1!(do_parse!( [INFO] [stderr] 130 | | num: call!(nom::digit) >> // Eventually, validate using this [INFO] [stderr] 131 | | tag!(". ") >> [INFO] [stderr] ... | [INFO] [stderr] 135 | | )) >> tag!("\n") >> (it) [INFO] [stderr] 136 | | ) [INFO] [stderr] | |_____^ [INFO] [stderr] | [INFO] [stderr] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#redundant_closure [INFO] [stderr] = note: this error originates in a macro outside of the current crate (in Nightly builds, run with -Z external-macro-backtrace for more info) [INFO] [stderr] [INFO] [stderr] warning: the function has a cyclomatic complexity of 31 [INFO] [stderr] --> src/main.rs:152:1 [INFO] [stderr] | [INFO] [stderr] 152 | / fn h_wrapper<'a>(input: &'a str, level: u8) -> IResult<&'a str, StructuredCollection> { [INFO] [stderr] 153 | | if(level == 0) { [INFO] [stderr] 154 | | let x = alt!(input, [INFO] [stderr] 155 | | do_parse!(tag!("# ") >> name: take_till!(|ch| ch == '\n') >> tag!("\n\n") >> (name)) | [INFO] [stderr] ... | [INFO] [stderr] 168 | | } [INFO] [stderr] 169 | | } [INFO] [stderr] | |_^ [INFO] [stderr] | [INFO] [stderr] = help: you could split it up into multiple smaller functions [INFO] [stderr] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#cyclomatic_complexity [INFO] [stderr] [INFO] [stderr] warning: redundant closure found [INFO] [stderr] --> src/main.rs:154:13 [INFO] [stderr] | [INFO] [stderr] 154 | let x = alt!(input, [INFO] [stderr] | _____________^ [INFO] [stderr] 155 | | do_parse!(tag!("# ") >> name: take_till!(|ch| ch == '\n') >> tag!("\n\n") >> (name)) | [INFO] [stderr] 156 | | map!(verify!(do_parse!(name: take_till!(|ch| ch == '\n') >> tag!("\n") >> underscore: take_while!(|c| c == '=') >> tag!("\n\n") >> (name, underscore)), |(txt, underscore): (&str, &str)| UnicodeSegmentation::graphemes(txt, true).collect::>().len() == UnicodeSegmentation::graphemes(underscore, true).collect::>().len()), |(txt, len)| txt)); [INFO] [stderr] | |____________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________^ [INFO] [stderr] | [INFO] [stderr] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#redundant_closure [INFO] [stderr] = note: this error originates in a macro outside of the current crate (in Nightly builds, run with -Z external-macro-backtrace for more info) [INFO] [stderr] [INFO] [stderr] warning: redundant closure found [INFO] [stderr] --> src/main.rs:154:13 [INFO] [stderr] | [INFO] [stderr] 154 | let x = alt!(input, [INFO] [stderr] | _____________^ [INFO] [stderr] 155 | | do_parse!(tag!("# ") >> name: take_till!(|ch| ch == '\n') >> tag!("\n\n") >> (name)) | [INFO] [stderr] 156 | | map!(verify!(do_parse!(name: take_till!(|ch| ch == '\n') >> tag!("\n") >> underscore: take_while!(|c| c == '=') >> tag!("\n\n") >> (name, underscore)), |(txt, underscore): (&str, &str)| UnicodeSegmentation::graphemes(txt, true).collect::>().len() == UnicodeSegmentation::graphemes(underscore, true).collect::>().len()), |(txt, len)| txt)); [INFO] [stderr] | |____________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________^ [INFO] [stderr] | [INFO] [stderr] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#redundant_closure [INFO] [stderr] = note: this error originates in a macro outside of the current crate (in Nightly builds, run with -Z external-macro-backtrace for more info) [INFO] [stderr] [INFO] [stderr] warning: avoid using `collect()` when not needed [INFO] [stderr] --> src/main.rs:156:242 [INFO] [stderr] | [INFO] [stderr] 156 | map!(verify!(do_parse!(name: take_till!(|ch| ch == '\n') >> tag!("\n") >> underscore: take_while!(|c| c == '=') >> tag!("\n\n") >> (name, underscore)), |(txt, underscore): (&str, &str)| UnicodeSegmentation::graphemes(txt, true).collect::>().len() == UnicodeSegmentation::graphemes(underscore, true).collect::>().len()), |(txt, len)| txt)); [INFO] [stderr] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: replace with: `.count()` [INFO] [stderr] | [INFO] [stderr] = note: #[warn(clippy::needless_collect)] on by default [INFO] [stderr] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_collect [INFO] [stderr] [INFO] [stderr] warning: avoid using `collect()` when not needed [INFO] [stderr] --> src/main.rs:156:323 [INFO] [stderr] | [INFO] [stderr] 156 | map!(verify!(do_parse!(name: take_till!(|ch| ch == '\n') >> tag!("\n") >> underscore: take_while!(|c| c == '=') >> tag!("\n\n") >> (name, underscore)), |(txt, underscore): (&str, &str)| UnicodeSegmentation::graphemes(txt, true).collect::>().len() == UnicodeSegmentation::graphemes(underscore, true).collect::>().len()), |(txt, len)| txt)); [INFO] [stderr] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: replace with: `.count()` [INFO] [stderr] | [INFO] [stderr] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_collect [INFO] [stderr] [INFO] [stderr] warning: redundant closure found [INFO] [stderr] --> src/main.rs:163:13 [INFO] [stderr] | [INFO] [stderr] 163 | let x = do_parse!(input, tag!(hashes) >> many0!(tag!(" ")) >> name: take_till!(|ch| ch == '\n') >> tag!("\n") >> (name)); [INFO] [stderr] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ [INFO] [stderr] | [INFO] [stderr] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#redundant_closure [INFO] [stderr] = note: this error originates in a macro outside of the current crate (in Nightly builds, run with -Z external-macro-backtrace for more info) [INFO] [stderr] [INFO] [stderr] warning: the function has a cyclomatic complexity of 41 [INFO] [stderr] --> src/main.rs:170:1 [INFO] [stderr] | [INFO] [stderr] 170 | / fn h_sub_wrapper<'a>(input: &'a str, level: u8, name: &'a str) -> IResult<&'a str, StructuredCollection<'a>> { [INFO] [stderr] 171 | | do_parse!(input, [INFO] [stderr] 172 | | // Assume that something is text until we hit a start token for anything else [INFO] [stderr] 173 | | text: many0!(do_parse!( [INFO] [stderr] ... | [INFO] [stderr] 190 | | ) [INFO] [stderr] 191 | | } [INFO] [stderr] | |_^ [INFO] [stderr] | [INFO] [stderr] = help: you could split it up into multiple smaller functions [INFO] [stderr] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#cyclomatic_complexity [INFO] [stderr] [INFO] [stderr] warning: redundant closure found [INFO] [stderr] --> src/main.rs:171:3 [INFO] [stderr] | [INFO] [stderr] 171 | / do_parse!(input, [INFO] [stderr] 172 | | // Assume that something is text until we hit a start token for anything else [INFO] [stderr] 173 | | text: many0!(do_parse!( [INFO] [stderr] 174 | | // Check against start tokens - TODO: be more thorough about this [INFO] [stderr] ... | [INFO] [stderr] 189 | | }) [INFO] [stderr] 190 | | ) [INFO] [stderr] | |___^ [INFO] [stderr] | [INFO] [stderr] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#redundant_closure [INFO] [stderr] = note: this error originates in a macro outside of the current crate (in Nightly builds, run with -Z external-macro-backtrace for more info) [INFO] [stderr] [INFO] [stderr] warning: length comparison to zero [INFO] [stderr] --> src/main.rs:185:17 [INFO] [stderr] | [INFO] [stderr] 185 | text: (if text.len() == 0 || (text.len() == 1 && text[0] == "") { None } else { Some(text.iter().fold(String::new(), |acc, x| acc + &format!("{}\n", x)).clone()) }), [INFO] [stderr] | ^^^^^^^^^^^^^^^ help: using `is_empty` is clearer and more explicit: `text.is_empty()` [INFO] [stderr] | [INFO] [stderr] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#len_zero [INFO] [stderr] [INFO] [stderr] warning: you seem to be trying to use match for destructuring a single pattern. Consider using `if let` [INFO] [stderr] --> src/main.rs:217:3 [INFO] [stderr] | [INFO] [stderr] 217 | / match file.read_to_string(&mut s) { [INFO] [stderr] 218 | | Err(why) => panic!("couldn't read {}: {}", &input_file, [INFO] [stderr] 219 | | why.description()), [INFO] [stderr] 220 | | _ => () [INFO] [stderr] 221 | | } [INFO] [stderr] | |___^ [INFO] [stderr] | [INFO] [stderr] = note: #[warn(clippy::single_match)] on by default [INFO] [stderr] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#single_match [INFO] [stderr] help: try this [INFO] [stderr] | [INFO] [stderr] 217 | if let Err(why) = file.read_to_string(&mut s) { panic!("couldn't read {}: {}", &input_file, [INFO] [stderr] 218 | why.description()) } [INFO] [stderr] | [INFO] [stderr] [INFO] [stderr] warning: use of a blacklisted/placeholder name `foo` [INFO] [stderr] --> src/main.rs:222:7 [INFO] [stderr] | [INFO] [stderr] 222 | let foo = s.clone(); [INFO] [stderr] | ^^^ [INFO] [stderr] | [INFO] [stderr] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#blacklisted_name [INFO] [stderr] [INFO] [stderr] warning: useless use of `format!` [INFO] [stderr] --> src/main.rs:229:23 [INFO] [stderr] | [INFO] [stderr] 229 | "--html" => format!("{}", all_to_html(&doc)), [INFO] [stderr] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: consider using .to_string(): `all_to_html(&doc).to_string()` [INFO] [stderr] | [INFO] [stderr] = note: #[warn(clippy::useless_format)] on by default [INFO] [stderr] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#useless_format [INFO] [stderr] = note: this error originates in a macro outside of the current crate (in Nightly builds, run with -Z external-macro-backtrace for more info) [INFO] [stderr] [INFO] [stderr] warning: useless use of `format!` [INFO] [stderr] --> src/main.rs:231:17 [INFO] [stderr] | [INFO] [stderr] 231 | Ok(x) => format!("{}", x), [INFO] [stderr] | ^^^^^^^^^^^^^^^^ help: consider using .to_string(): `x.to_string()` [INFO] [stderr] | [INFO] [stderr] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#useless_format [INFO] [stderr] = note: this error originates in a macro outside of the current crate (in Nightly builds, run with -Z external-macro-backtrace for more info) [INFO] [stderr] [INFO] [stderr] warning: use of a blacklisted/placeholder name `foo` [INFO] [stderr] --> src/main.rs:283:7 [INFO] [stderr] | [INFO] [stderr] 283 | let foo = s.clone(); [INFO] [stderr] | ^^^ [INFO] [stderr] | [INFO] [stderr] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#blacklisted_name [INFO] [stderr] [INFO] [stderr] warning: you seem to be trying to use match for destructuring a single pattern. Consider using `if let` [INFO] [stderr] --> src/main.rs:306:5 [INFO] [stderr] | [INFO] [stderr] 306 | / match fd.read_to_string(&mut contents) { [INFO] [stderr] 307 | | Err(why) => panic!("couldn't read {}: {}", path.display(), [INFO] [stderr] 308 | | why.description()), [INFO] [stderr] 309 | | _ => () [INFO] [stderr] 310 | | } [INFO] [stderr] | |_____^ [INFO] [stderr] | [INFO] [stderr] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#single_match [INFO] [stderr] help: try this [INFO] [stderr] | [INFO] [stderr] 306 | if let Err(why) = fd.read_to_string(&mut contents) { panic!("couldn't read {}: {}", path.display(), [INFO] [stderr] 307 | why.description()) } [INFO] [stderr] | [INFO] [stderr] [INFO] [stderr] error: aborting due to previous error [INFO] [stderr] [INFO] [stderr] error: Could not compile `pineapplepizza`. [INFO] [stderr] [INFO] [stderr] To learn more, run the command again with --verbose. [INFO] running `"docker" "inspect" "4bd4555a4d093fb4882f4d723ea751c9097ef460f162c5e6648fd5665356ef9e"` [INFO] running `"docker" "rm" "-f" "4bd4555a4d093fb4882f4d723ea751c9097ef460f162c5e6648fd5665356ef9e"` [INFO] [stdout] 4bd4555a4d093fb4882f4d723ea751c9097ef460f162c5e6648fd5665356ef9e