[INFO] updating cached repository saarw/cstruct2rs [INFO] running `"git" "fetch" "--all"` [INFO] [stdout] Fetching origin [INFO] [stderr] From git://github.com/saarw/cstruct2rs [INFO] [stderr] * branch HEAD -> FETCH_HEAD [INFO] running `"git" "clone" "work/cache/sources/gh/saarw/cstruct2rs" "work/ex/clippy-test-run/sources/stable/gh/saarw/cstruct2rs"` [INFO] [stderr] Cloning into 'work/ex/clippy-test-run/sources/stable/gh/saarw/cstruct2rs'... [INFO] [stderr] done. [INFO] running `"git" "clone" "work/cache/sources/gh/saarw/cstruct2rs" "work/ex/clippy-test-run/sources/stable+rustflags=-Dclippy%3A%3Ainto_iter_on_array/gh/saarw/cstruct2rs"` [INFO] [stderr] Cloning into 'work/ex/clippy-test-run/sources/stable+rustflags=-Dclippy%3A%3Ainto_iter_on_array/gh/saarw/cstruct2rs'... [INFO] [stderr] done. [INFO] running `"git" "rev-parse" "HEAD"` [INFO] [stdout] 8e53895724d6e22da6056430e8dab2ef9661f9ac [INFO] sha for GitHub repo saarw/cstruct2rs: 8e53895724d6e22da6056430e8dab2ef9661f9ac [INFO] validating manifest of saarw/cstruct2rs 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 saarw/cstruct2rs 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 saarw/cstruct2rs [INFO] finished frobbing saarw/cstruct2rs [INFO] frobbed toml for saarw/cstruct2rs written to work/ex/clippy-test-run/sources/stable/gh/saarw/cstruct2rs/Cargo.toml [INFO] started frobbing saarw/cstruct2rs [INFO] finished frobbing saarw/cstruct2rs [INFO] frobbed toml for saarw/cstruct2rs written to work/ex/clippy-test-run/sources/stable+rustflags=-Dclippy%3A%3Ainto_iter_on_array/gh/saarw/cstruct2rs/Cargo.toml [INFO] crate saarw/cstruct2rs has a lockfile. skipping [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 saarw/cstruct2rs against stable for clippy-test-run [INFO] running `"docker" "create" "-v" "/mnt/big/crater/work/local/target-dirs/clippy-test-run/worker-3/stable:/opt/crater/target:rw,Z" "-v" "/mnt/big/crater/work/ex/clippy-test-run/sources/stable/gh/saarw/cstruct2rs:/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] af22ad4c1517f5274ff5835bf237377f7425a1fb2d48a8a1cc0f3fbac5d10d9f [INFO] running `"docker" "start" "-a" "af22ad4c1517f5274ff5835bf237377f7425a1fb2d48a8a1cc0f3fbac5d10d9f"` [INFO] [stderr] Checking cstruct2rs v0.0.1 (/opt/crater/workdir) [INFO] [stderr] warning: redundant field names in struct initialization [INFO] [stderr] --> src/cinfo.rs:19:4 [INFO] [stderr] | [INFO] [stderr] 19 | name: name, [INFO] [stderr] | ^^^^^^^^^^ help: replace it with: `name` [INFO] [stderr] | [INFO] [stderr] = note: #[warn(clippy::redundant_field_names)] on by default [INFO] [stderr] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#redundant_field_names [INFO] [stderr] [INFO] [stderr] warning: using `write!()` with a format string that ends in a single newline, consider using `writeln!()` instead [INFO] [stderr] --> src/cinfo.rs:31:4 [INFO] [stderr] | [INFO] [stderr] 31 | write!(f, "\tpub {}: {},\n", field_name, field_type).ok().expect("Write failed!"); [INFO] [stderr] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ [INFO] [stderr] | [INFO] [stderr] = note: #[warn(clippy::write_with_newline)] on by default [INFO] [stderr] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#write_with_newline [INFO] [stderr] [INFO] [stderr] warning: using `write!()` with a format string that ends in a single newline, consider using `writeln!()` instead [INFO] [stderr] --> src/cinfo.rs:33:3 [INFO] [stderr] | [INFO] [stderr] 33 | write!(f, "}}\n") [INFO] [stderr] | ^^^^^^^^^^^^^^^^^ [INFO] [stderr] | [INFO] [stderr] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#write_with_newline [INFO] [stderr] [INFO] [stderr] warning: redundant field names in struct initialization [INFO] [stderr] --> src/cinfo.rs:19:4 [INFO] [stderr] | [INFO] [stderr] 19 | name: name, [INFO] [stderr] | ^^^^^^^^^^ help: replace it with: `name` [INFO] [stderr] | [INFO] [stderr] = note: #[warn(clippy::redundant_field_names)] on by default [INFO] [stderr] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#redundant_field_names [INFO] [stderr] [INFO] [stderr] warning: using `write!()` with a format string that ends in a single newline, consider using `writeln!()` instead [INFO] [stderr] --> src/cinfo.rs:31:4 [INFO] [stderr] | [INFO] [stderr] 31 | write!(f, "\tpub {}: {},\n", field_name, field_type).ok().expect("Write failed!"); [INFO] [stderr] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ [INFO] [stderr] | [INFO] [stderr] = note: #[warn(clippy::write_with_newline)] on by default [INFO] [stderr] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#write_with_newline [INFO] [stderr] [INFO] [stderr] warning: using `write!()` with a format string that ends in a single newline, consider using `writeln!()` instead [INFO] [stderr] --> src/cinfo.rs:33:3 [INFO] [stderr] | [INFO] [stderr] 33 | write!(f, "}}\n") [INFO] [stderr] | ^^^^^^^^^^^^^^^^^ [INFO] [stderr] | [INFO] [stderr] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#write_with_newline [INFO] [stderr] [INFO] [stderr] warning: unneeded return statement [INFO] [stderr] --> src/cinfo.rs:153:2 [INFO] [stderr] | [INFO] [stderr] 153 | return names_qualified_types; [INFO] [stderr] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: remove `return` as shown: `names_qualified_types` [INFO] [stderr] | [INFO] [stderr] = note: #[warn(clippy::needless_return)] on by default [INFO] [stderr] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_return [INFO] [stderr] [INFO] [stderr] warning: unneeded return statement [INFO] [stderr] --> src/main.rs:82:2 [INFO] [stderr] | [INFO] [stderr] 82 | return structs; [INFO] [stderr] | ^^^^^^^^^^^^^^^ help: remove `return` as shown: `structs` [INFO] [stderr] | [INFO] [stderr] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_return [INFO] [stderr] [INFO] [stderr] warning: unneeded return statement [INFO] [stderr] --> src/cinfo.rs:153:2 [INFO] [stderr] | [INFO] [stderr] 153 | return names_qualified_types; [INFO] [stderr] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: remove `return` as shown: `names_qualified_types` [INFO] [stderr] | [INFO] [stderr] = note: #[warn(clippy::needless_return)] on by default [INFO] [stderr] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_return [INFO] [stderr] [INFO] [stderr] warning: unneeded return statement [INFO] [stderr] --> src/main.rs:82:2 [INFO] [stderr] | [INFO] [stderr] 82 | return structs; [INFO] [stderr] | ^^^^^^^^^^^^^^^ help: remove `return` as shown: `structs` [INFO] [stderr] | [INFO] [stderr] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_return [INFO] [stderr] [INFO] [stderr] warning: variable does not need to be mutable [INFO] [stderr] --> src/cinfo.rs:90:6 [INFO] [stderr] | [INFO] [stderr] 90 | let mut name_buf: Cow; [INFO] [stderr] | ----^^^^^^^^ [INFO] [stderr] | | [INFO] [stderr] | help: remove this `mut` [INFO] [stderr] | [INFO] [stderr] = note: #[warn(unused_mut)] on by default [INFO] [stderr] [INFO] [stderr] warning: variable does not need to be mutable [INFO] [stderr] --> src/cinfo.rs:91:6 [INFO] [stderr] | [INFO] [stderr] 91 | let mut var_name: Cow; [INFO] [stderr] | ----^^^^^^^^ [INFO] [stderr] | | [INFO] [stderr] | help: remove this `mut` [INFO] [stderr] [INFO] [stderr] warning: single-character string constant used as pattern [INFO] [stderr] --> src/cinfo.rs:15:39 [INFO] [stderr] | [INFO] [stderr] 15 | let type_names = struct_block.split(";").filter(|line| line.trim().len() > 0). [INFO] [stderr] | ^^^ help: try using a char instead: `';'` [INFO] [stderr] | [INFO] [stderr] = note: #[warn(clippy::single_char_pattern)] on by default [INFO] [stderr] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#single_char_pattern [INFO] [stderr] [INFO] [stderr] warning: length comparison to zero [INFO] [stderr] --> src/cinfo.rs:15:58 [INFO] [stderr] | [INFO] [stderr] 15 | let type_names = struct_block.split(";").filter(|line| line.trim().len() > 0). [INFO] [stderr] | ^^^^^^^^^^^^^^^^^^^^^ help: using `is_empty` is clearer and more explicit: `!line.trim().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: you seem to be trying to use match for destructuring a single pattern. Consider using `if let` [INFO] [stderr] --> src/cinfo.rs:70:7 [INFO] [stderr] | [INFO] [stderr] 70 | match peeker.peek() { [INFO] [stderr] | _________________________^ [INFO] [stderr] 71 | | Some(&typename_3) => if typename_3 == "long" { peeker.next(); }, [INFO] [stderr] 72 | | None => {}, [INFO] [stderr] 73 | | }; [INFO] [stderr] | |_________________________________^ help: try this: `if let Some(&typename_3) = peeker.peek() { if typename_3 == "long" { peeker.next(); } }` [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] [INFO] [stderr] warning: single-character string constant used as pattern [INFO] [stderr] --> src/cinfo.rs:94:37 [INFO] [stderr] | [INFO] [stderr] 94 | if let Some(ptr_start) = name.find("*") { [INFO] [stderr] | ^^^ help: try using a char instead: `'*'` [INFO] [stderr] | [INFO] [stderr] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#single_char_pattern [INFO] [stderr] [INFO] [stderr] warning: this `.fold` can be written more succinctly using another method [INFO] [stderr] --> src/cinfo.rs:96:70 [INFO] [stderr] | [INFO] [stderr] 96 | for _ in 0..name.chars().map(|c: char| match c { '*' => 1, _ => 0}).fold(0, |acc, val| acc + val) { [INFO] [stderr] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: try: `.sum()` [INFO] [stderr] | [INFO] [stderr] = note: #[warn(clippy::unnecessary_fold)] on by default [INFO] [stderr] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#unnecessary_fold [INFO] [stderr] [INFO] [stderr] warning: very complex type used. Consider factoring parts into `type` definitions [INFO] [stderr] --> src/cinfo.rs:112:38 [INFO] [stderr] | [INFO] [stderr] 112 | let (start_brackets, end_brackets): (Vec<(usize, char)>, Vec<(usize, char)>) = (&name).char_indices(). [INFO] [stderr] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ [INFO] [stderr] | [INFO] [stderr] = note: #[warn(clippy::type_complexity)] on by default [INFO] [stderr] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#type_complexity [INFO] [stderr] [INFO] [stderr] warning: length comparison to zero [INFO] [stderr] --> src/cinfo.rs:118:5 [INFO] [stderr] | [INFO] [stderr] 118 | if array_sizes.len() > 0 { [INFO] [stderr] | ^^^^^^^^^^^^^^^^^^^^^ help: using `is_empty` is clearer and more explicit: `!array_sizes.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 `unwrap_or` followed by a function call [INFO] [stderr] --> src/cinfo.rs:124:103 [INFO] [stderr] | [INFO] [stderr] 124 | var_name = Cow::Owned(name_buf[..name_buf.find(|c: char| c == '[' || c == ')' || c.is_whitespace()).unwrap_or(name_buf.len())].to_string()); [INFO] [stderr] | ^^^^^^^^^^^^^^^^^^^^^^^^^ help: try this: `unwrap_or_else(|| name_buf.len())` [INFO] [stderr] | [INFO] [stderr] = note: #[warn(clippy::or_fun_call)] on by default [INFO] [stderr] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#or_fun_call [INFO] [stderr] [INFO] [stderr] warning: identical conversion [INFO] [stderr] --> src/cinfo.rs:157:2 [INFO] [stderr] | [INFO] [stderr] 157 | line.split(",").into_iter().map(|name| extract_name_and_array_pointer_type(base_type, name.to_string())).collect::>() [INFO] [stderr] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: consider removing `.into_iter()`: `line.split(",")` [INFO] [stderr] | [INFO] [stderr] = note: #[warn(clippy::identity_conversion)] on by default [INFO] [stderr] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#identity_conversion [INFO] [stderr] [INFO] [stderr] warning: single-character string constant used as pattern [INFO] [stderr] --> src/cinfo.rs:157:13 [INFO] [stderr] | [INFO] [stderr] 157 | line.split(",").into_iter().map(|name| extract_name_and_array_pointer_type(base_type, name.to_string())).collect::>() [INFO] [stderr] | ^^^ help: try using a char instead: `','` [INFO] [stderr] | [INFO] [stderr] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#single_char_pattern [INFO] [stderr] [INFO] [stderr] warning: single-character string constant used as pattern [INFO] [stderr] --> src/main.rs:60:48 [INFO] [stderr] | [INFO] [stderr] 60 | if let Some(block_start) = buf[pos..].find("{") { [INFO] [stderr] | ^^^ help: try using a char instead: `'{'` [INFO] [stderr] | [INFO] [stderr] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#single_char_pattern [INFO] [stderr] [INFO] [stderr] warning: single-character string constant used as pattern [INFO] [stderr] --> src/main.rs:61:63 [INFO] [stderr] | [INFO] [stderr] 61 | if let Some(block_end) = buf[(pos + block_start)..].find("}") { [INFO] [stderr] | ^^^ help: try using a char instead: `'}'` [INFO] [stderr] | [INFO] [stderr] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#single_char_pattern [INFO] [stderr] [INFO] [stderr] warning: single-character string constant used as pattern [INFO] [stderr] --> src/main.rs:64:49 [INFO] [stderr] | [INFO] [stderr] 64 | if let Some(semi_colon) = buf[pos..].find(";") { [INFO] [stderr] | ^^^ help: try using a char instead: `';'` [INFO] [stderr] | [INFO] [stderr] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#single_char_pattern [INFO] [stderr] [INFO] [stderr] warning: called `ok().expect()` on a Result value. You can call `expect` directly on the `Result` [INFO] [stderr] --> src/main.rs:104:22 [INFO] [stderr] | [INFO] [stderr] 104 | let mut infile = File::open(infile_name).ok().expect("Failed to open input file"); [INFO] [stderr] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ [INFO] [stderr] | [INFO] [stderr] = note: #[warn(clippy::ok_expect)] on by default [INFO] [stderr] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#ok_expect [INFO] [stderr] [INFO] [stderr] warning: called `ok().expect()` on a Result value. You can call `expect` directly on the `Result` [INFO] [stderr] --> src/main.rs:106:5 [INFO] [stderr] | [INFO] [stderr] 106 | infile.read_to_string(&mut buf).ok().expect("Failed to read file"); [INFO] [stderr] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ [INFO] [stderr] | [INFO] [stderr] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#ok_expect [INFO] [stderr] [INFO] [stderr] warning: called `ok().expect()` on a Result value. You can call `expect` directly on the `Result` [INFO] [stderr] --> src/main.rs:107:23 [INFO] [stderr] | [INFO] [stderr] 107 | let mut outfile = File::create(outfile_name).ok().expect("Failed to open out file"); [INFO] [stderr] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ [INFO] [stderr] | [INFO] [stderr] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#ok_expect [INFO] [stderr] [INFO] [stderr] warning: called `ok().expect()` on a Result value. You can call `expect` directly on the `Result` [INFO] [stderr] --> src/main.rs:122:5 [INFO] [stderr] | [INFO] [stderr] 122 | outfile.write_all(use_statement.as_bytes()).ok().expect("Write failed!"); [INFO] [stderr] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ [INFO] [stderr] | [INFO] [stderr] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#ok_expect [INFO] [stderr] [INFO] [stderr] warning: called `ok().expect()` on a Result value. You can call `expect` directly on the `Result` [INFO] [stderr] --> src/main.rs:125:6 [INFO] [stderr] | [INFO] [stderr] 125 | outfile.write_all(format!("{}\n", struct_info).as_bytes()).ok().expect("Write failed!"); [INFO] [stderr] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ [INFO] [stderr] | [INFO] [stderr] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#ok_expect [INFO] [stderr] [INFO] [stderr] warning: variable does not need to be mutable [INFO] [stderr] --> src/cinfo.rs:90:6 [INFO] [stderr] | [INFO] [stderr] 90 | let mut name_buf: Cow; [INFO] [stderr] | ----^^^^^^^^ [INFO] [stderr] | | [INFO] [stderr] | help: remove this `mut` [INFO] [stderr] | [INFO] [stderr] = note: #[warn(unused_mut)] on by default [INFO] [stderr] [INFO] [stderr] warning: variable does not need to be mutable [INFO] [stderr] --> src/cinfo.rs:91:6 [INFO] [stderr] | [INFO] [stderr] 91 | let mut var_name: Cow; [INFO] [stderr] | ----^^^^^^^^ [INFO] [stderr] | | [INFO] [stderr] | help: remove this `mut` [INFO] [stderr] [INFO] [stderr] warning: single-character string constant used as pattern [INFO] [stderr] --> src/cinfo.rs:15:39 [INFO] [stderr] | [INFO] [stderr] 15 | let type_names = struct_block.split(";").filter(|line| line.trim().len() > 0). [INFO] [stderr] | ^^^ help: try using a char instead: `';'` [INFO] [stderr] | [INFO] [stderr] = note: #[warn(clippy::single_char_pattern)] on by default [INFO] [stderr] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#single_char_pattern [INFO] [stderr] [INFO] [stderr] warning: length comparison to zero [INFO] [stderr] --> src/cinfo.rs:15:58 [INFO] [stderr] | [INFO] [stderr] 15 | let type_names = struct_block.split(";").filter(|line| line.trim().len() > 0). [INFO] [stderr] | ^^^^^^^^^^^^^^^^^^^^^ help: using `is_empty` is clearer and more explicit: `!line.trim().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: you seem to be trying to use match for destructuring a single pattern. Consider using `if let` [INFO] [stderr] --> src/cinfo.rs:70:7 [INFO] [stderr] | [INFO] [stderr] 70 | match peeker.peek() { [INFO] [stderr] | _________________________^ [INFO] [stderr] 71 | | Some(&typename_3) => if typename_3 == "long" { peeker.next(); }, [INFO] [stderr] 72 | | None => {}, [INFO] [stderr] 73 | | }; [INFO] [stderr] | |_________________________________^ help: try this: `if let Some(&typename_3) = peeker.peek() { if typename_3 == "long" { peeker.next(); } }` [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] [INFO] [stderr] warning: single-character string constant used as pattern [INFO] [stderr] --> src/cinfo.rs:94:37 [INFO] [stderr] | [INFO] [stderr] 94 | if let Some(ptr_start) = name.find("*") { [INFO] [stderr] | ^^^ help: try using a char instead: `'*'` [INFO] [stderr] | [INFO] [stderr] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#single_char_pattern [INFO] [stderr] [INFO] [stderr] warning: this `.fold` can be written more succinctly using another method [INFO] [stderr] --> src/cinfo.rs:96:70 [INFO] [stderr] | [INFO] [stderr] 96 | for _ in 0..name.chars().map(|c: char| match c { '*' => 1, _ => 0}).fold(0, |acc, val| acc + val) { [INFO] [stderr] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: try: `.sum()` [INFO] [stderr] | [INFO] [stderr] = note: #[warn(clippy::unnecessary_fold)] on by default [INFO] [stderr] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#unnecessary_fold [INFO] [stderr] [INFO] [stderr] warning: very complex type used. Consider factoring parts into `type` definitions [INFO] [stderr] --> src/cinfo.rs:112:38 [INFO] [stderr] | [INFO] [stderr] 112 | let (start_brackets, end_brackets): (Vec<(usize, char)>, Vec<(usize, char)>) = (&name).char_indices(). [INFO] [stderr] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ [INFO] [stderr] | [INFO] [stderr] = note: #[warn(clippy::type_complexity)] on by default [INFO] [stderr] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#type_complexity [INFO] [stderr] [INFO] [stderr] warning: length comparison to zero [INFO] [stderr] --> src/cinfo.rs:118:5 [INFO] [stderr] | [INFO] [stderr] 118 | if array_sizes.len() > 0 { [INFO] [stderr] | ^^^^^^^^^^^^^^^^^^^^^ help: using `is_empty` is clearer and more explicit: `!array_sizes.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 `unwrap_or` followed by a function call [INFO] [stderr] --> src/cinfo.rs:124:103 [INFO] [stderr] | [INFO] [stderr] 124 | var_name = Cow::Owned(name_buf[..name_buf.find(|c: char| c == '[' || c == ')' || c.is_whitespace()).unwrap_or(name_buf.len())].to_string()); [INFO] [stderr] | ^^^^^^^^^^^^^^^^^^^^^^^^^ help: try this: `unwrap_or_else(|| name_buf.len())` [INFO] [stderr] | [INFO] [stderr] = note: #[warn(clippy::or_fun_call)] on by default [INFO] [stderr] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#or_fun_call [INFO] [stderr] [INFO] [stderr] warning: identical conversion [INFO] [stderr] --> src/cinfo.rs:157:2 [INFO] [stderr] | [INFO] [stderr] 157 | line.split(",").into_iter().map(|name| extract_name_and_array_pointer_type(base_type, name.to_string())).collect::>() [INFO] [stderr] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: consider removing `.into_iter()`: `line.split(",")` [INFO] [stderr] | [INFO] [stderr] = note: #[warn(clippy::identity_conversion)] on by default [INFO] [stderr] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#identity_conversion [INFO] [stderr] [INFO] [stderr] warning: single-character string constant used as pattern [INFO] [stderr] --> src/cinfo.rs:157:13 [INFO] [stderr] | [INFO] [stderr] 157 | line.split(",").into_iter().map(|name| extract_name_and_array_pointer_type(base_type, name.to_string())).collect::>() [INFO] [stderr] | ^^^ help: try using a char instead: `','` [INFO] [stderr] | [INFO] [stderr] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#single_char_pattern [INFO] [stderr] [INFO] [stderr] warning: single-character string constant used as pattern [INFO] [stderr] --> src/main.rs:60:48 [INFO] [stderr] | [INFO] [stderr] 60 | if let Some(block_start) = buf[pos..].find("{") { [INFO] [stderr] | ^^^ help: try using a char instead: `'{'` [INFO] [stderr] | [INFO] [stderr] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#single_char_pattern [INFO] [stderr] [INFO] [stderr] warning: single-character string constant used as pattern [INFO] [stderr] --> src/main.rs:61:63 [INFO] [stderr] | [INFO] [stderr] 61 | if let Some(block_end) = buf[(pos + block_start)..].find("}") { [INFO] [stderr] | ^^^ help: try using a char instead: `'}'` [INFO] [stderr] | [INFO] [stderr] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#single_char_pattern [INFO] [stderr] [INFO] [stderr] warning: single-character string constant used as pattern [INFO] [stderr] --> src/main.rs:64:49 [INFO] [stderr] | [INFO] [stderr] 64 | if let Some(semi_colon) = buf[pos..].find(";") { [INFO] [stderr] | ^^^ help: try using a char instead: `';'` [INFO] [stderr] | [INFO] [stderr] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#single_char_pattern [INFO] [stderr] [INFO] [stderr] warning: called `ok().expect()` on a Result value. You can call `expect` directly on the `Result` [INFO] [stderr] --> src/main.rs:104:22 [INFO] [stderr] | [INFO] [stderr] 104 | let mut infile = File::open(infile_name).ok().expect("Failed to open input file"); [INFO] [stderr] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ [INFO] [stderr] | [INFO] [stderr] = note: #[warn(clippy::ok_expect)] on by default [INFO] [stderr] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#ok_expect [INFO] [stderr] [INFO] [stderr] warning: called `ok().expect()` on a Result value. You can call `expect` directly on the `Result` [INFO] [stderr] --> src/main.rs:106:5 [INFO] [stderr] | [INFO] [stderr] 106 | infile.read_to_string(&mut buf).ok().expect("Failed to read file"); [INFO] [stderr] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ [INFO] [stderr] | [INFO] [stderr] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#ok_expect [INFO] [stderr] [INFO] [stderr] warning: called `ok().expect()` on a Result value. You can call `expect` directly on the `Result` [INFO] [stderr] --> src/main.rs:107:23 [INFO] [stderr] | [INFO] [stderr] 107 | let mut outfile = File::create(outfile_name).ok().expect("Failed to open out file"); [INFO] [stderr] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ [INFO] [stderr] | [INFO] [stderr] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#ok_expect [INFO] [stderr] [INFO] [stderr] warning: called `ok().expect()` on a Result value. You can call `expect` directly on the `Result` [INFO] [stderr] --> src/main.rs:122:5 [INFO] [stderr] | [INFO] [stderr] 122 | outfile.write_all(use_statement.as_bytes()).ok().expect("Write failed!"); [INFO] [stderr] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ [INFO] [stderr] | [INFO] [stderr] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#ok_expect [INFO] [stderr] [INFO] [stderr] warning: called `ok().expect()` on a Result value. You can call `expect` directly on the `Result` [INFO] [stderr] --> src/main.rs:125:6 [INFO] [stderr] | [INFO] [stderr] 125 | outfile.write_all(format!("{}\n", struct_info).as_bytes()).ok().expect("Write failed!"); [INFO] [stderr] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ [INFO] [stderr] | [INFO] [stderr] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#ok_expect [INFO] [stderr] [INFO] [stderr] Finished dev [unoptimized + debuginfo] target(s) in 0.91s [INFO] running `"docker" "inspect" "af22ad4c1517f5274ff5835bf237377f7425a1fb2d48a8a1cc0f3fbac5d10d9f"` [INFO] running `"docker" "rm" "-f" "af22ad4c1517f5274ff5835bf237377f7425a1fb2d48a8a1cc0f3fbac5d10d9f"` [INFO] [stdout] af22ad4c1517f5274ff5835bf237377f7425a1fb2d48a8a1cc0f3fbac5d10d9f