[INFO] updating cached repository tbergqvist/LuffarLib [INFO] running `"git" "fetch" "--all"` [INFO] [stdout] Fetching origin [INFO] [stderr] From git://github.com/tbergqvist/LuffarLib [INFO] [stderr] * branch HEAD -> FETCH_HEAD [INFO] running `"git" "clone" "work/cache/sources/gh/tbergqvist/LuffarLib" "work/ex/clippy-test-run/sources/stable/gh/tbergqvist/LuffarLib"` [INFO] [stderr] Cloning into 'work/ex/clippy-test-run/sources/stable/gh/tbergqvist/LuffarLib'... [INFO] [stderr] done. [INFO] running `"git" "clone" "work/cache/sources/gh/tbergqvist/LuffarLib" "work/ex/clippy-test-run/sources/stable+rustflags=-Dclippy%3A%3Ainto_iter_on_array/gh/tbergqvist/LuffarLib"` [INFO] [stderr] Cloning into 'work/ex/clippy-test-run/sources/stable+rustflags=-Dclippy%3A%3Ainto_iter_on_array/gh/tbergqvist/LuffarLib'... [INFO] [stderr] done. [INFO] running `"git" "rev-parse" "HEAD"` [INFO] [stdout] e44c428e8806e8246fc0335d3e7b88780ca3e404 [INFO] sha for GitHub repo tbergqvist/LuffarLib: e44c428e8806e8246fc0335d3e7b88780ca3e404 [INFO] validating manifest of tbergqvist/LuffarLib 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 tbergqvist/LuffarLib 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 tbergqvist/LuffarLib [INFO] finished frobbing tbergqvist/LuffarLib [INFO] frobbed toml for tbergqvist/LuffarLib written to work/ex/clippy-test-run/sources/stable/gh/tbergqvist/LuffarLib/Cargo.toml [INFO] started frobbing tbergqvist/LuffarLib [INFO] finished frobbing tbergqvist/LuffarLib [INFO] frobbed toml for tbergqvist/LuffarLib written to work/ex/clippy-test-run/sources/stable+rustflags=-Dclippy%3A%3Ainto_iter_on_array/gh/tbergqvist/LuffarLib/Cargo.toml [INFO] crate tbergqvist/LuffarLib 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 tbergqvist/LuffarLib against stable for clippy-test-run [INFO] running `"docker" "create" "-v" "/mnt/big/crater/work/local/target-dirs/clippy-test-run/worker-7/stable:/opt/crater/target:rw,Z" "-v" "/mnt/big/crater/work/ex/clippy-test-run/sources/stable/gh/tbergqvist/LuffarLib:/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] 835ef67b9219fde74d4a6dd9a82f0ddc94b867482ffed025d9911c62e6f3e1bb [INFO] running `"docker" "start" "-a" "835ef67b9219fde74d4a6dd9a82f0ddc94b867482ffed025d9911c62e6f3e1bb"` [INFO] [stderr] Checking luffar_lib v0.1.0 (/opt/crater/workdir) [INFO] [stderr] warning: redundant field names in struct initialization [INFO] [stderr] --> src/lib.rs:56:5 [INFO] [stderr] | [INFO] [stderr] 56 | board: board, [INFO] [stderr] | ^^^^^^^^^^^^ help: replace it with: `board` [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: redundant field names in struct initialization [INFO] [stderr] --> src/lib.rs:58:5 [INFO] [stderr] | [INFO] [stderr] 58 | winner: winner, [INFO] [stderr] | ^^^^^^^^^^^^^^ help: replace it with: `winner` [INFO] [stderr] | [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: redundant field names in struct initialization [INFO] [stderr] --> src/lib.rs:102:5 [INFO] [stderr] | [INFO] [stderr] 102 | required_row_length: required_row_length, [INFO] [stderr] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: replace it with: `required_row_length` [INFO] [stderr] | [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: redundant field names in struct initialization [INFO] [stderr] --> src/lib.rs:56:5 [INFO] [stderr] | [INFO] [stderr] 56 | board: board, [INFO] [stderr] | ^^^^^^^^^^^^ help: replace it with: `board` [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: redundant field names in struct initialization [INFO] [stderr] --> src/lib.rs:58:5 [INFO] [stderr] | [INFO] [stderr] 58 | winner: winner, [INFO] [stderr] | ^^^^^^^^^^^^^^ help: replace it with: `winner` [INFO] [stderr] | [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: redundant field names in struct initialization [INFO] [stderr] --> src/lib.rs:102:5 [INFO] [stderr] | [INFO] [stderr] 102 | required_row_length: required_row_length, [INFO] [stderr] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: replace it with: `required_row_length` [INFO] [stderr] | [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: unneeded return statement [INFO] [stderr] --> src/lib.rs:14:3 [INFO] [stderr] | [INFO] [stderr] 14 | / return board.iter().fold( [INFO] [stderr] 15 | | true, |acc, rows| acc && rows.iter().fold( [INFO] [stderr] 16 | | true, |acc, &cell| acc && cell.is_none()) [INFO] [stderr] 17 | | ); [INFO] [stderr] | |______^ [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] help: remove `return` as shown [INFO] [stderr] | [INFO] [stderr] 14 | board.iter().fold( [INFO] [stderr] 15 | true, |acc, rows| acc && rows.iter().fold( [INFO] [stderr] 16 | true, |acc, &cell| acc && cell.is_none()) [INFO] [stderr] 17 | ) [INFO] [stderr] | [INFO] [stderr] [INFO] [stderr] warning: unneeded return statement [INFO] [stderr] --> src/lib.rs:34:3 [INFO] [stderr] | [INFO] [stderr] 34 | / return GameState { [INFO] [stderr] 35 | | error: Some(error), [INFO] [stderr] 36 | | ..game_state [INFO] [stderr] 37 | | } [INFO] [stderr] | |___^ [INFO] [stderr] | [INFO] [stderr] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_return [INFO] [stderr] help: remove `return` as shown [INFO] [stderr] | [INFO] [stderr] 34 | GameState { [INFO] [stderr] 35 | error: Some(error), [INFO] [stderr] 36 | ..game_state [INFO] [stderr] 37 | } [INFO] [stderr] | [INFO] [stderr] [INFO] [stderr] warning: writing `&Vec<_>` instead of `&[_]` involves one more reference and cannot be used with non-Vec-based slices. [INFO] [stderr] --> src/win_check.rs:3:35 [INFO] [stderr] | [INFO] [stderr] 3 | pub fn check_win_condition(board: &GameBoard, player: Player, required_row_length: usize) -> bool { [INFO] [stderr] | ^^^^^^^^^^ [INFO] [stderr] | [INFO] [stderr] = note: #[warn(clippy::ptr_arg)] on by default [INFO] [stderr] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#ptr_arg [INFO] [stderr] [INFO] [stderr] warning: manual implementation of an assign operation [INFO] [stderr] --> src/win_check.rs:13:5 [INFO] [stderr] | [INFO] [stderr] 13 | *same_count = *same_count + 1; [INFO] [stderr] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: replace it with: `*same_count += 1` [INFO] [stderr] | [INFO] [stderr] = note: #[warn(clippy::assign_op_pattern)] on by default [INFO] [stderr] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#assign_op_pattern [INFO] [stderr] [INFO] [stderr] warning: writing `&Vec<_>` instead of `&[_]` involves one more reference and cannot be used with non-Vec-based slices. [INFO] [stderr] --> src/win_check.rs:21:25 [INFO] [stderr] | [INFO] [stderr] 21 | fn check_columns(board: &GameBoard, player: Option, required_row_length: usize) -> bool { [INFO] [stderr] | ^^^^^^^^^^ [INFO] [stderr] | [INFO] [stderr] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#ptr_arg [INFO] [stderr] [INFO] [stderr] warning: this `.fold` can be written more succinctly using another method [INFO] [stderr] --> src/win_check.rs:22:22 [INFO] [stderr] | [INFO] [stderr] 22 | (0..board[0].len()).fold(false, |won, x| { [INFO] [stderr] | ______________________^ [INFO] [stderr] 23 | | won || [INFO] [stderr] 24 | | (0..board.len()) [INFO] [stderr] 25 | | .map(|y| board[y][x]) [INFO] [stderr] ... | [INFO] [stderr] 29 | | .is_some() [INFO] [stderr] 30 | | }) [INFO] [stderr] | |____^ [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] help: try [INFO] [stderr] | [INFO] [stderr] 22 | (0..board[0].len()).any(|x| (0..board.len()) [INFO] [stderr] 23 | .map(|y| board[y][x]) [INFO] [stderr] 24 | .scan(0, |current_count, cell| count_same(current_count, cell, player)) [INFO] [stderr] 25 | .skip_while(|count| *count < required_row_length) [INFO] [stderr] 26 | .next() [INFO] [stderr] 27 | .is_some()) [INFO] [stderr] | [INFO] [stderr] [INFO] [stderr] warning: writing `&Vec<_>` instead of `&[_]` involves one more reference and cannot be used with non-Vec-based slices. [INFO] [stderr] --> src/win_check.rs:33:22 [INFO] [stderr] | [INFO] [stderr] 33 | fn check_rows(board: &GameBoard, player: Option, required_row_length: usize) -> bool { [INFO] [stderr] | ^^^^^^^^^^ [INFO] [stderr] | [INFO] [stderr] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#ptr_arg [INFO] [stderr] [INFO] [stderr] warning: this `.fold` can be written more succinctly using another method [INFO] [stderr] --> src/win_check.rs:34:19 [INFO] [stderr] | [INFO] [stderr] 34 | (0..board.len()).fold(false, |won, y| { [INFO] [stderr] | ___________________^ [INFO] [stderr] 35 | | won || [INFO] [stderr] 36 | | (0..board[0].len()) [INFO] [stderr] 37 | | .map(|x| board[y][x]) [INFO] [stderr] ... | [INFO] [stderr] 41 | | .is_some() [INFO] [stderr] 42 | | }) [INFO] [stderr] | |____^ [INFO] [stderr] | [INFO] [stderr] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#unnecessary_fold [INFO] [stderr] help: try [INFO] [stderr] | [INFO] [stderr] 34 | (0..board.len()).any(|y| (0..board[0].len()) [INFO] [stderr] 35 | .map(|x| board[y][x]) [INFO] [stderr] 36 | .scan(0, |current_count, cell| count_same(current_count, cell, player)) [INFO] [stderr] 37 | .skip_while(|count| *count < required_row_length) [INFO] [stderr] 38 | .next() [INFO] [stderr] 39 | .is_some()) [INFO] [stderr] | [INFO] [stderr] [INFO] [stderr] warning: writing `&Vec<_>` instead of `&[_]` involves one more reference and cannot be used with non-Vec-based slices. [INFO] [stderr] --> src/win_check.rs:45:26 [INFO] [stderr] | [INFO] [stderr] 45 | fn check_diagonal(board: &GameBoard, player: Option, required_row_length: usize) -> bool { [INFO] [stderr] | ^^^^^^^^^^ [INFO] [stderr] | [INFO] [stderr] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#ptr_arg [INFO] [stderr] [INFO] [stderr] warning: this `.fold` can be written more succinctly using another method [INFO] [stderr] --> src/win_check.rs:46:22 [INFO] [stderr] | [INFO] [stderr] 46 | (0..board[0].len()).fold(false, |won, x| { [INFO] [stderr] | ______________________^ [INFO] [stderr] 47 | | won || [INFO] [stderr] 48 | | (0..board.len()) [INFO] [stderr] 49 | | .map(|y| board[y][(y + x) % board[0].len()]) //This hack will not work if board is fixed size [INFO] [stderr] ... | [INFO] [stderr] 53 | | .is_some() [INFO] [stderr] 54 | | }) [INFO] [stderr] | |____^ [INFO] [stderr] | [INFO] [stderr] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#unnecessary_fold [INFO] [stderr] help: try [INFO] [stderr] | [INFO] [stderr] 46 | (0..board[0].len()).any(|x| (0..board.len()) [INFO] [stderr] 47 | .map(|y| board[y][(y + x) % board[0].len()]) //This hack will not work if board is fixed size [INFO] [stderr] 48 | .scan(0, |current_count, cell| count_same(current_count, cell, player)) [INFO] [stderr] 49 | .skip_while(|count| *count < required_row_length) [INFO] [stderr] 50 | .next() [INFO] [stderr] 51 | .is_some()) [INFO] [stderr] | [INFO] [stderr] [INFO] [stderr] warning: this `.fold` can be written more succinctly using another method [INFO] [stderr] --> src/win_check.rs:56:22 [INFO] [stderr] | [INFO] [stderr] 56 | (2..board[0].len()).fold(false, |won, x| { [INFO] [stderr] | ______________________^ [INFO] [stderr] 57 | | won || [INFO] [stderr] 58 | | (0..x + 1).filter(|y| *y < board.len()) [INFO] [stderr] 59 | | .map(|y| board[y][(x - y)]) [INFO] [stderr] ... | [INFO] [stderr] 63 | | .is_some() [INFO] [stderr] 64 | | }) [INFO] [stderr] | |____^ [INFO] [stderr] | [INFO] [stderr] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#unnecessary_fold [INFO] [stderr] help: try [INFO] [stderr] | [INFO] [stderr] 56 | (2..board[0].len()).any(|x| (0..x + 1).filter(|y| *y < board.len()) [INFO] [stderr] 57 | .map(|y| board[y][(x - y)]) [INFO] [stderr] 58 | .scan(0, |current_count, cell| count_same(current_count, cell, player)) [INFO] [stderr] 59 | .skip_while(|count| *count < required_row_length) [INFO] [stderr] 60 | .next() [INFO] [stderr] 61 | .is_some()) [INFO] [stderr] | [INFO] [stderr] [INFO] [stderr] warning: an inclusive range would be more readable [INFO] [stderr] --> src/win_check.rs:58:5 [INFO] [stderr] | [INFO] [stderr] 58 | (0..x + 1).filter(|y| *y < board.len()) [INFO] [stderr] | ^^^^^^^^^^ help: use: `(0..=x)` [INFO] [stderr] | [INFO] [stderr] = note: #[warn(clippy::range_plus_one)] on by default [INFO] [stderr] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#range_plus_one [INFO] [stderr] [INFO] [stderr] warning: this `.fold` can be written more succinctly using another method [INFO] [stderr] --> src/win_check.rs:66:22 [INFO] [stderr] | [INFO] [stderr] 66 | (2..board[0].len()).fold(false, |won, x| { [INFO] [stderr] | ______________________^ [INFO] [stderr] 67 | | won || [INFO] [stderr] 68 | | (0..x + 1).filter(|y| *y < board.len()) [INFO] [stderr] 69 | | .map(|y| board[board.len() - y - 1][board[0].len() - (x - y)- 1]) [INFO] [stderr] ... | [INFO] [stderr] 73 | | .is_some() [INFO] [stderr] 74 | | }) [INFO] [stderr] | |____^ [INFO] [stderr] | [INFO] [stderr] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#unnecessary_fold [INFO] [stderr] help: try [INFO] [stderr] | [INFO] [stderr] 66 | (2..board[0].len()).any(|x| (0..x + 1).filter(|y| *y < board.len()) [INFO] [stderr] 67 | .map(|y| board[board.len() - y - 1][board[0].len() - (x - y)- 1]) [INFO] [stderr] 68 | .scan(0, |current_count, cell| count_same(current_count, cell, player)) [INFO] [stderr] 69 | .skip_while(|count| *count < required_row_length) [INFO] [stderr] 70 | .next() [INFO] [stderr] 71 | .is_some()) [INFO] [stderr] | [INFO] [stderr] [INFO] [stderr] warning: an inclusive range would be more readable [INFO] [stderr] --> src/win_check.rs:68:5 [INFO] [stderr] | [INFO] [stderr] 68 | (0..x + 1).filter(|y| *y < board.len()) [INFO] [stderr] | ^^^^^^^^^^ help: use: `(0..=x)` [INFO] [stderr] | [INFO] [stderr] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#range_plus_one [INFO] [stderr] [INFO] [stderr] warning: unneeded return statement [INFO] [stderr] --> src/lib.rs:14:3 [INFO] [stderr] | [INFO] [stderr] 14 | / return board.iter().fold( [INFO] [stderr] 15 | | true, |acc, rows| acc && rows.iter().fold( [INFO] [stderr] 16 | | true, |acc, &cell| acc && cell.is_none()) [INFO] [stderr] 17 | | ); [INFO] [stderr] | |______^ [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] help: remove `return` as shown [INFO] [stderr] | [INFO] [stderr] 14 | board.iter().fold( [INFO] [stderr] 15 | true, |acc, rows| acc && rows.iter().fold( [INFO] [stderr] 16 | true, |acc, &cell| acc && cell.is_none()) [INFO] [stderr] 17 | ) [INFO] [stderr] | [INFO] [stderr] [INFO] [stderr] warning: unneeded return statement [INFO] [stderr] --> src/lib.rs:34:3 [INFO] [stderr] | [INFO] [stderr] 34 | / return GameState { [INFO] [stderr] 35 | | error: Some(error), [INFO] [stderr] 36 | | ..game_state [INFO] [stderr] 37 | | } [INFO] [stderr] | |___^ [INFO] [stderr] | [INFO] [stderr] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_return [INFO] [stderr] help: remove `return` as shown [INFO] [stderr] | [INFO] [stderr] 34 | GameState { [INFO] [stderr] 35 | error: Some(error), [INFO] [stderr] 36 | ..game_state [INFO] [stderr] 37 | } [INFO] [stderr] | [INFO] [stderr] [INFO] [stderr] warning: this argument is passed by reference, but would be more efficient if passed by value [INFO] [stderr] --> src/lib.rs:6:28 [INFO] [stderr] | [INFO] [stderr] 6 | fn opposite_player(player: &Player) -> Player { [INFO] [stderr] | ^^^^^^^ help: consider passing by value instead: `Player` [INFO] [stderr] | [INFO] [stderr] = note: #[warn(clippy::trivially_copy_pass_by_ref)] on by default [INFO] [stderr] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#trivially_copy_pass_by_ref [INFO] [stderr] [INFO] [stderr] warning: writing `&Vec<_>` instead of `&[_]` involves one more reference and cannot be used with non-Vec-based slices. [INFO] [stderr] --> src/lib.rs:13:29 [INFO] [stderr] | [INFO] [stderr] 13 | fn has_no_cells_left(board: &GameBoard) -> bool { [INFO] [stderr] | ^^^^^^^^^^ [INFO] [stderr] | [INFO] [stderr] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#ptr_arg [INFO] [stderr] [INFO] [stderr] warning: this `.fold` can be written more succinctly using another method [INFO] [stderr] --> src/lib.rs:14:22 [INFO] [stderr] | [INFO] [stderr] 14 | return board.iter().fold( [INFO] [stderr] | ______________________^ [INFO] [stderr] 15 | | true, |acc, rows| acc && rows.iter().fold( [INFO] [stderr] 16 | | true, |acc, &cell| acc && cell.is_none()) [INFO] [stderr] 17 | | ); [INFO] [stderr] | |_ [INFO] [stderr] | [INFO] [stderr] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#unnecessary_fold [INFO] [stderr] help: try [INFO] [stderr] | [INFO] [stderr] 14 | return board.iter().all(|rows| rows.iter().fold( [INFO] [stderr] 15 | true, |acc, &cell| acc && cell.is_none())) ); [INFO] [stderr] | [INFO] [stderr] [INFO] [stderr] warning: this `.fold` can be written more succinctly using another method [INFO] [stderr] --> src/lib.rs:15:41 [INFO] [stderr] | [INFO] [stderr] 15 | true, |acc, rows| acc && rows.iter().fold( [INFO] [stderr] | _________________________________________^ [INFO] [stderr] 16 | | true, |acc, &cell| acc && cell.is_none()) [INFO] [stderr] | |_________________________________________________^ help: try: `.all(|cell| cell.is_none())` [INFO] [stderr] | [INFO] [stderr] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#unnecessary_fold [INFO] [stderr] [INFO] [stderr] warning: writing `&Vec<_>` instead of `&[_]` involves one more reference and cannot be used with non-Vec-based slices. [INFO] [stderr] --> src/lib.rs:20:22 [INFO] [stderr] | [INFO] [stderr] 20 | fn get_winner(board: &GameBoard, player: Player, required_row_length: usize) -> Option { [INFO] [stderr] | ^^^^^^^^^^ [INFO] [stderr] | [INFO] [stderr] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#ptr_arg [INFO] [stderr] [INFO] [stderr] warning: writing `&Vec<_>` instead of `&[_]` involves one more reference and cannot be used with non-Vec-based slices. [INFO] [stderr] --> src/win_check.rs:3:35 [INFO] [stderr] | [INFO] [stderr] 3 | pub fn check_win_condition(board: &GameBoard, player: Player, required_row_length: usize) -> bool { [INFO] [stderr] | ^^^^^^^^^^ [INFO] [stderr] | [INFO] [stderr] = note: #[warn(clippy::ptr_arg)] on by default [INFO] [stderr] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#ptr_arg [INFO] [stderr] [INFO] [stderr] warning: manual implementation of an assign operation [INFO] [stderr] --> src/win_check.rs:13:5 [INFO] [stderr] | [INFO] [stderr] 13 | *same_count = *same_count + 1; [INFO] [stderr] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: replace it with: `*same_count += 1` [INFO] [stderr] | [INFO] [stderr] = note: #[warn(clippy::assign_op_pattern)] on by default [INFO] [stderr] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#assign_op_pattern [INFO] [stderr] [INFO] [stderr] warning: writing `&Vec<_>` instead of `&[_]` involves one more reference and cannot be used with non-Vec-based slices. [INFO] [stderr] --> src/win_check.rs:21:25 [INFO] [stderr] | [INFO] [stderr] 21 | fn check_columns(board: &GameBoard, player: Option, required_row_length: usize) -> bool { [INFO] [stderr] | ^^^^^^^^^^ [INFO] [stderr] | [INFO] [stderr] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#ptr_arg [INFO] [stderr] [INFO] [stderr] warning: this `.fold` can be written more succinctly using another method [INFO] [stderr] --> src/win_check.rs:22:22 [INFO] [stderr] | [INFO] [stderr] 22 | (0..board[0].len()).fold(false, |won, x| { [INFO] [stderr] | ______________________^ [INFO] [stderr] 23 | | won || [INFO] [stderr] 24 | | (0..board.len()) [INFO] [stderr] 25 | | .map(|y| board[y][x]) [INFO] [stderr] ... | [INFO] [stderr] 29 | | .is_some() [INFO] [stderr] 30 | | }) [INFO] [stderr] | |____^ [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] help: try [INFO] [stderr] | [INFO] [stderr] 22 | (0..board[0].len()).any(|x| (0..board.len()) [INFO] [stderr] 23 | .map(|y| board[y][x]) [INFO] [stderr] 24 | .scan(0, |current_count, cell| count_same(current_count, cell, player)) [INFO] [stderr] 25 | .skip_while(|count| *count < required_row_length) [INFO] [stderr] 26 | .next() [INFO] [stderr] 27 | .is_some()) [INFO] [stderr] | [INFO] [stderr] [INFO] [stderr] warning: writing `&Vec<_>` instead of `&[_]` involves one more reference and cannot be used with non-Vec-based slices. [INFO] [stderr] --> src/win_check.rs:33:22 [INFO] [stderr] | [INFO] [stderr] 33 | fn check_rows(board: &GameBoard, player: Option, required_row_length: usize) -> bool { [INFO] [stderr] | ^^^^^^^^^^ [INFO] [stderr] | [INFO] [stderr] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#ptr_arg [INFO] [stderr] [INFO] [stderr] warning: this `.fold` can be written more succinctly using another method [INFO] [stderr] --> src/win_check.rs:34:19 [INFO] [stderr] | [INFO] [stderr] 34 | (0..board.len()).fold(false, |won, y| { [INFO] [stderr] | ___________________^ [INFO] [stderr] 35 | | won || [INFO] [stderr] 36 | | (0..board[0].len()) [INFO] [stderr] 37 | | .map(|x| board[y][x]) [INFO] [stderr] ... | [INFO] [stderr] 41 | | .is_some() [INFO] [stderr] 42 | | }) [INFO] [stderr] | |____^ [INFO] [stderr] | [INFO] [stderr] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#unnecessary_fold [INFO] [stderr] help: try [INFO] [stderr] | [INFO] [stderr] 34 | (0..board.len()).any(|y| (0..board[0].len()) [INFO] [stderr] 35 | .map(|x| board[y][x]) [INFO] [stderr] 36 | .scan(0, |current_count, cell| count_same(current_count, cell, player)) [INFO] [stderr] 37 | .skip_while(|count| *count < required_row_length) [INFO] [stderr] 38 | .next() [INFO] [stderr] 39 | .is_some()) [INFO] [stderr] | [INFO] [stderr] [INFO] [stderr] warning: writing `&Vec<_>` instead of `&[_]` involves one more reference and cannot be used with non-Vec-based slices. [INFO] [stderr] --> src/win_check.rs:45:26 [INFO] [stderr] | [INFO] [stderr] 45 | fn check_diagonal(board: &GameBoard, player: Option, required_row_length: usize) -> bool { [INFO] [stderr] | ^^^^^^^^^^ [INFO] [stderr] | [INFO] [stderr] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#ptr_arg [INFO] [stderr] [INFO] [stderr] warning: this `.fold` can be written more succinctly using another method [INFO] [stderr] --> src/win_check.rs:46:22 [INFO] [stderr] | [INFO] [stderr] 46 | (0..board[0].len()).fold(false, |won, x| { [INFO] [stderr] | ______________________^ [INFO] [stderr] 47 | | won || [INFO] [stderr] 48 | | (0..board.len()) [INFO] [stderr] 49 | | .map(|y| board[y][(y + x) % board[0].len()]) //This hack will not work if board is fixed size [INFO] [stderr] ... | [INFO] [stderr] 53 | | .is_some() [INFO] [stderr] 54 | | }) [INFO] [stderr] | |____^ [INFO] [stderr] | [INFO] [stderr] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#unnecessary_fold [INFO] [stderr] help: try [INFO] [stderr] | [INFO] [stderr] 46 | (0..board[0].len()).any(|x| (0..board.len()) [INFO] [stderr] 47 | .map(|y| board[y][(y + x) % board[0].len()]) //This hack will not work if board is fixed size [INFO] [stderr] 48 | .scan(0, |current_count, cell| count_same(current_count, cell, player)) [INFO] [stderr] 49 | .skip_while(|count| *count < required_row_length) [INFO] [stderr] 50 | .next() [INFO] [stderr] 51 | .is_some()) [INFO] [stderr] | [INFO] [stderr] [INFO] [stderr] warning: this `.fold` can be written more succinctly using another method [INFO] [stderr] --> src/win_check.rs:56:22 [INFO] [stderr] | [INFO] [stderr] 56 | (2..board[0].len()).fold(false, |won, x| { [INFO] [stderr] | ______________________^ [INFO] [stderr] 57 | | won || [INFO] [stderr] 58 | | (0..x + 1).filter(|y| *y < board.len()) [INFO] [stderr] 59 | | .map(|y| board[y][(x - y)]) [INFO] [stderr] ... | [INFO] [stderr] 63 | | .is_some() [INFO] [stderr] 64 | | }) [INFO] [stderr] | |____^ [INFO] [stderr] | [INFO] [stderr] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#unnecessary_fold [INFO] [stderr] help: try [INFO] [stderr] | [INFO] [stderr] 56 | (2..board[0].len()).any(|x| (0..x + 1).filter(|y| *y < board.len()) [INFO] [stderr] 57 | .map(|y| board[y][(x - y)]) [INFO] [stderr] 58 | .scan(0, |current_count, cell| count_same(current_count, cell, player)) [INFO] [stderr] 59 | .skip_while(|count| *count < required_row_length) [INFO] [stderr] 60 | .next() [INFO] [stderr] 61 | .is_some()) [INFO] [stderr] | [INFO] [stderr] [INFO] [stderr] warning: an inclusive range would be more readable [INFO] [stderr] --> src/win_check.rs:58:5 [INFO] [stderr] | [INFO] [stderr] 58 | (0..x + 1).filter(|y| *y < board.len()) [INFO] [stderr] | ^^^^^^^^^^ help: use: `(0..=x)` [INFO] [stderr] | [INFO] [stderr] = note: #[warn(clippy::range_plus_one)] on by default [INFO] [stderr] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#range_plus_one [INFO] [stderr] [INFO] [stderr] warning: this `.fold` can be written more succinctly using another method [INFO] [stderr] --> src/win_check.rs:66:22 [INFO] [stderr] | [INFO] [stderr] 66 | (2..board[0].len()).fold(false, |won, x| { [INFO] [stderr] | ______________________^ [INFO] [stderr] 67 | | won || [INFO] [stderr] 68 | | (0..x + 1).filter(|y| *y < board.len()) [INFO] [stderr] 69 | | .map(|y| board[board.len() - y - 1][board[0].len() - (x - y)- 1]) [INFO] [stderr] ... | [INFO] [stderr] 73 | | .is_some() [INFO] [stderr] 74 | | }) [INFO] [stderr] | |____^ [INFO] [stderr] | [INFO] [stderr] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#unnecessary_fold [INFO] [stderr] help: try [INFO] [stderr] | [INFO] [stderr] 66 | (2..board[0].len()).any(|x| (0..x + 1).filter(|y| *y < board.len()) [INFO] [stderr] 67 | .map(|y| board[board.len() - y - 1][board[0].len() - (x - y)- 1]) [INFO] [stderr] 68 | .scan(0, |current_count, cell| count_same(current_count, cell, player)) [INFO] [stderr] 69 | .skip_while(|count| *count < required_row_length) [INFO] [stderr] 70 | .next() [INFO] [stderr] 71 | .is_some()) [INFO] [stderr] | [INFO] [stderr] [INFO] [stderr] warning: an inclusive range would be more readable [INFO] [stderr] --> src/win_check.rs:68:5 [INFO] [stderr] | [INFO] [stderr] 68 | (0..x + 1).filter(|y| *y < board.len()) [INFO] [stderr] | ^^^^^^^^^^ help: use: `(0..=x)` [INFO] [stderr] | [INFO] [stderr] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#range_plus_one [INFO] [stderr] [INFO] [stderr] warning: this argument is passed by reference, but would be more efficient if passed by value [INFO] [stderr] --> src/lib.rs:6:28 [INFO] [stderr] | [INFO] [stderr] 6 | fn opposite_player(player: &Player) -> Player { [INFO] [stderr] | ^^^^^^^ help: consider passing by value instead: `Player` [INFO] [stderr] | [INFO] [stderr] = note: #[warn(clippy::trivially_copy_pass_by_ref)] on by default [INFO] [stderr] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#trivially_copy_pass_by_ref [INFO] [stderr] [INFO] [stderr] warning: writing `&Vec<_>` instead of `&[_]` involves one more reference and cannot be used with non-Vec-based slices. [INFO] [stderr] --> src/lib.rs:13:29 [INFO] [stderr] | [INFO] [stderr] 13 | fn has_no_cells_left(board: &GameBoard) -> bool { [INFO] [stderr] | ^^^^^^^^^^ [INFO] [stderr] | [INFO] [stderr] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#ptr_arg [INFO] [stderr] [INFO] [stderr] warning: this `.fold` can be written more succinctly using another method [INFO] [stderr] --> src/lib.rs:14:22 [INFO] [stderr] | [INFO] [stderr] 14 | return board.iter().fold( [INFO] [stderr] | ______________________^ [INFO] [stderr] 15 | | true, |acc, rows| acc && rows.iter().fold( [INFO] [stderr] 16 | | true, |acc, &cell| acc && cell.is_none()) [INFO] [stderr] 17 | | ); [INFO] [stderr] | |_ [INFO] [stderr] | [INFO] [stderr] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#unnecessary_fold [INFO] [stderr] help: try [INFO] [stderr] | [INFO] [stderr] 14 | return board.iter().all(|rows| rows.iter().fold( [INFO] [stderr] 15 | true, |acc, &cell| acc && cell.is_none())) ); [INFO] [stderr] | [INFO] [stderr] [INFO] [stderr] warning: this `.fold` can be written more succinctly using another method [INFO] [stderr] --> src/lib.rs:15:41 [INFO] [stderr] | [INFO] [stderr] 15 | true, |acc, rows| acc && rows.iter().fold( [INFO] [stderr] | _________________________________________^ [INFO] [stderr] 16 | | true, |acc, &cell| acc && cell.is_none()) [INFO] [stderr] | |_________________________________________________^ help: try: `.all(|cell| cell.is_none())` [INFO] [stderr] | [INFO] [stderr] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#unnecessary_fold [INFO] [stderr] [INFO] [stderr] warning: writing `&Vec<_>` instead of `&[_]` involves one more reference and cannot be used with non-Vec-based slices. [INFO] [stderr] --> src/lib.rs:20:22 [INFO] [stderr] | [INFO] [stderr] 20 | fn get_winner(board: &GameBoard, player: Player, required_row_length: usize) -> Option { [INFO] [stderr] | ^^^^^^^^^^ [INFO] [stderr] | [INFO] [stderr] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#ptr_arg [INFO] [stderr] [INFO] [stderr] Finished dev [unoptimized + debuginfo] target(s) in 0.78s [INFO] running `"docker" "inspect" "835ef67b9219fde74d4a6dd9a82f0ddc94b867482ffed025d9911c62e6f3e1bb"` [INFO] running `"docker" "rm" "-f" "835ef67b9219fde74d4a6dd9a82f0ddc94b867482ffed025d9911c62e6f3e1bb"` [INFO] [stdout] 835ef67b9219fde74d4a6dd9a82f0ddc94b867482ffed025d9911c62e6f3e1bb