Skip to content

Fix clippy warning #1875

Fix clippy warning

Fix clippy warning #1875

Triggered via push February 1, 2024 08:13
Status Success
Total duration 3m 19s
Artifacts

rust.yml

on: push
Test Suite
55s
Test Suite
Test Benches
52s
Test Benches
Matrix: Check
Matrix: Clippy
Matrix: Rustfmt
Fit to window
Zoom out
Zoom in

Annotations

60 warnings
Rustfmt (stable)
Node.js 16 actions are deprecated. Please update the following actions to use Node.js 20: actions/checkout@v3, actions-rs/toolchain@v1, actions-rs/cargo@v1. For more information see: https://github.blog/changelog/2023-09-22-github-actions-transitioning-from-node-16-to-node-20/.
Rustfmt (stable)
The following actions uses node12 which is deprecated and will be forced to run on node16: actions-rs/toolchain@v1, actions-rs/cargo@v1. For more info: https://github.blog/changelog/2023-06-13-github-actions-all-actions-will-run-on-node16-instead-of-node12-by-default/
Rustfmt (stable)
The `set-output` command is deprecated and will be disabled soon. Please upgrade to using Environment Files. For more information see: https://github.blog/changelog/2022-10-11-github-actions-deprecating-save-state-and-set-output-commands/
Rustfmt (stable)
The `set-output` command is deprecated and will be disabled soon. Please upgrade to using Environment Files. For more information see: https://github.blog/changelog/2022-10-11-github-actions-deprecating-save-state-and-set-output-commands/
Rustfmt (stable)
The `set-output` command is deprecated and will be disabled soon. Please upgrade to using Environment Files. For more information see: https://github.blog/changelog/2022-10-11-github-actions-deprecating-save-state-and-set-output-commands/
Rustfmt (stable)
The `set-output` command is deprecated and will be disabled soon. Please upgrade to using Environment Files. For more information see: https://github.blog/changelog/2022-10-11-github-actions-deprecating-save-state-and-set-output-commands/
Rustfmt (1.65.0)
Node.js 16 actions are deprecated. Please update the following actions to use Node.js 20: actions/checkout@v3, actions-rs/toolchain@v1, actions-rs/cargo@v1. For more information see: https://github.blog/changelog/2023-09-22-github-actions-transitioning-from-node-16-to-node-20/.
Rustfmt (1.65.0)
The following actions uses node12 which is deprecated and will be forced to run on node16: actions-rs/toolchain@v1, actions-rs/cargo@v1. For more info: https://github.blog/changelog/2023-06-13-github-actions-all-actions-will-run-on-node16-instead-of-node12-by-default/
Rustfmt (1.65.0)
The `set-output` command is deprecated and will be disabled soon. Please upgrade to using Environment Files. For more information see: https://github.blog/changelog/2022-10-11-github-actions-deprecating-save-state-and-set-output-commands/
Rustfmt (1.65.0)
The `set-output` command is deprecated and will be disabled soon. Please upgrade to using Environment Files. For more information see: https://github.blog/changelog/2022-10-11-github-actions-deprecating-save-state-and-set-output-commands/
Rustfmt (1.65.0)
The `set-output` command is deprecated and will be disabled soon. Please upgrade to using Environment Files. For more information see: https://github.blog/changelog/2022-10-11-github-actions-deprecating-save-state-and-set-output-commands/
Rustfmt (1.65.0)
The `set-output` command is deprecated and will be disabled soon. Please upgrade to using Environment Files. For more information see: https://github.blog/changelog/2022-10-11-github-actions-deprecating-save-state-and-set-output-commands/
accessing first element with `hyper.targets.get(0)`: cgaal-engine/src/printer.rs#L64
warning: accessing first element with `hyper.targets.get(0)` --> cgaal-engine/src/printer.rs:64:38 | 64 | let target = hyper.targets.get(0).unwrap(); | ^^^^^^^^^^^^^^^^^^^^ help: try: `hyper.targets.first()` | = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#get_first
accessing first element with `e.targets.get(0)`: cgaal-engine/src/analyse.rs#L252
warning: accessing first element with `e.targets.get(0)` --> cgaal-engine/src/analyse.rs:252:45 | 252 | ... phi_stats(mssa, e.targets.get(0).unwrap()) | ^^^^^^^^^^^^^^^^ help: try: `e.targets.first()` | = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#get_first
accessing first element with `edg.succ(v).get(0)`: cgaal-engine/src/analyse.rs#L129
warning: accessing first element with `edg.succ(v).get(0)` --> cgaal-engine/src/analyse.rs:129:59 | 129 | target_stats: if let Edge::Hyper(e) = edg.succ(v).get(0).unwrap() { | ^^^^^^^^^^^^^^^^^^ help: try: `edg.succ(v).first()` | = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#get_first
accessing first element with `edg.succ(v).get(0)`: cgaal-engine/src/analyse.rs#L119
warning: accessing first element with `edg.succ(v).get(0)` --> cgaal-engine/src/analyse.rs:119:59 | 119 | target_stats: if let Edge::Hyper(e) = edg.succ(v).get(0).unwrap() { | ^^^^^^^^^^^^^^^^^^ help: try: `edg.succ(v).first()` | = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#get_first
accessing first element with `e.targets.get(0)`: cgaal-engine/src/analyse.rs#L109
warning: accessing first element with `e.targets.get(0)` --> cgaal-engine/src/analyse.rs:109:49 | 109 | ... phi_stats(mssa, e.targets.get(0).unwrap()) | ^^^^^^^^^^^^^^^^ help: try: `e.targets.first()` | = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#get_first = note: `#[warn(clippy::get_first)]` on by default
Check (stable)
Node.js 16 actions are deprecated. Please update the following actions to use Node.js 20: actions/checkout@v3, actions-rs/toolchain@v1, actions-rs/cargo@v1. For more information see: https://github.blog/changelog/2023-09-22-github-actions-transitioning-from-node-16-to-node-20/.
Check (stable)
The following actions uses node12 which is deprecated and will be forced to run on node16: actions-rs/toolchain@v1, actions-rs/cargo@v1. For more info: https://github.blog/changelog/2023-06-13-github-actions-all-actions-will-run-on-node16-instead-of-node12-by-default/
Check (stable)
The `set-output` command is deprecated and will be disabled soon. Please upgrade to using Environment Files. For more information see: https://github.blog/changelog/2022-10-11-github-actions-deprecating-save-state-and-set-output-commands/
Check (stable)
The `set-output` command is deprecated and will be disabled soon. Please upgrade to using Environment Files. For more information see: https://github.blog/changelog/2022-10-11-github-actions-deprecating-save-state-and-set-output-commands/
Check (stable)
The `set-output` command is deprecated and will be disabled soon. Please upgrade to using Environment Files. For more information see: https://github.blog/changelog/2022-10-11-github-actions-deprecating-save-state-and-set-output-commands/
Check (stable)
The `set-output` command is deprecated and will be disabled soon. Please upgrade to using Environment Files. For more information see: https://github.blog/changelog/2022-10-11-github-actions-deprecating-save-state-and-set-output-commands/
Clippy (stable)
Node.js 16 actions are deprecated. Please update the following actions to use Node.js 20: actions/checkout@v3, actions-rs/toolchain@v1, actions-rs/clippy-check@v1. For more information see: https://github.blog/changelog/2023-09-22-github-actions-transitioning-from-node-16-to-node-20/.
Clippy (stable)
The following actions uses node12 which is deprecated and will be forced to run on node16: actions-rs/toolchain@v1, actions-rs/clippy-check@v1. For more info: https://github.blog/changelog/2023-06-13-github-actions-all-actions-will-run-on-node16-instead-of-node12-by-default/
Clippy (stable)
The `set-output` command is deprecated and will be disabled soon. Please upgrade to using Environment Files. For more information see: https://github.blog/changelog/2022-10-11-github-actions-deprecating-save-state-and-set-output-commands/
Clippy (stable)
The `set-output` command is deprecated and will be disabled soon. Please upgrade to using Environment Files. For more information see: https://github.blog/changelog/2022-10-11-github-actions-deprecating-save-state-and-set-output-commands/
Clippy (stable)
The `set-output` command is deprecated and will be disabled soon. Please upgrade to using Environment Files. For more information see: https://github.blog/changelog/2022-10-11-github-actions-deprecating-save-state-and-set-output-commands/
Clippy (stable)
The `set-output` command is deprecated and will be disabled soon. Please upgrade to using Environment Files. For more information see: https://github.blog/changelog/2022-10-11-github-actions-deprecating-save-state-and-set-output-commands/
Test Benches
Node.js 16 actions are deprecated. Please update the following actions to use Node.js 20: actions/checkout@v3, actions-rs/toolchain@v1, actions-rs/cargo@v1. For more information see: https://github.blog/changelog/2023-09-22-github-actions-transitioning-from-node-16-to-node-20/.
Test Benches
The following actions uses node12 which is deprecated and will be forced to run on node16: actions-rs/toolchain@v1, actions-rs/cargo@v1. For more info: https://github.blog/changelog/2023-06-13-github-actions-all-actions-will-run-on-node16-instead-of-node12-by-default/
Test Benches
The `set-output` command is deprecated and will be disabled soon. Please upgrade to using Environment Files. For more information see: https://github.blog/changelog/2022-10-11-github-actions-deprecating-save-state-and-set-output-commands/
Test Benches
The `set-output` command is deprecated and will be disabled soon. Please upgrade to using Environment Files. For more information see: https://github.blog/changelog/2022-10-11-github-actions-deprecating-save-state-and-set-output-commands/
Test Benches
The `set-output` command is deprecated and will be disabled soon. Please upgrade to using Environment Files. For more information see: https://github.blog/changelog/2022-10-11-github-actions-deprecating-save-state-and-set-output-commands/
Test Benches
The `set-output` command is deprecated and will be disabled soon. Please upgrade to using Environment Files. For more information see: https://github.blog/changelog/2022-10-11-github-actions-deprecating-save-state-and-set-output-commands/
Test Suite
Node.js 16 actions are deprecated. Please update the following actions to use Node.js 20: actions/checkout@v3, actions-rs/toolchain@v1, actions-rs/cargo@v1. For more information see: https://github.blog/changelog/2023-09-22-github-actions-transitioning-from-node-16-to-node-20/.
Test Suite
The following actions uses node12 which is deprecated and will be forced to run on node16: actions-rs/toolchain@v1, actions-rs/cargo@v1. For more info: https://github.blog/changelog/2023-06-13-github-actions-all-actions-will-run-on-node16-instead-of-node12-by-default/
Test Suite
The `set-output` command is deprecated and will be disabled soon. Please upgrade to using Environment Files. For more information see: https://github.blog/changelog/2022-10-11-github-actions-deprecating-save-state-and-set-output-commands/
Test Suite
The `set-output` command is deprecated and will be disabled soon. Please upgrade to using Environment Files. For more information see: https://github.blog/changelog/2022-10-11-github-actions-deprecating-save-state-and-set-output-commands/
Test Suite
The `set-output` command is deprecated and will be disabled soon. Please upgrade to using Environment Files. For more information see: https://github.blog/changelog/2022-10-11-github-actions-deprecating-save-state-and-set-output-commands/
Test Suite
The `set-output` command is deprecated and will be disabled soon. Please upgrade to using Environment Files. For more information see: https://github.blog/changelog/2022-10-11-github-actions-deprecating-save-state-and-set-output-commands/
use of `unwrap_or` followed by a function call: cgaal-engine/src/parsing/mod.rs#L24
warning: use of `unwrap_or` followed by a function call --> cgaal-engine/src/parsing/mod.rs:24:10 | 24 | .unwrap_or(Expr::new_error()); | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: try this: `unwrap_or_else(|_| Expr::new_error())` | = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#or_fun_call
use of `ok_or` followed by a function call: cgaal-engine/src/game_structure/lcgs/symbol_checker.rs#L513
warning: use of `ok_or` followed by a function call --> cgaal-engine/src/game_structure/lcgs/symbol_checker.rs:513:18 | 513 | .ok_or(SpannedError::new( | __________________^ 514 | | id.span, 515 | | format!("Unknown player '{}'.", id.text), 516 | | ))?; | |__________________^ | = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#or_fun_call help: try this | 513 ~ .ok_or_else(|| SpannedError::new( 514 + id.span, 515 + format!("Unknown player '{}'.", id.text), 516 ~ ))?; |
use of `ok_or` followed by a function call: cgaal-engine/src/game_structure/lcgs/symbol_checker.rs#L336
warning: use of `ok_or` followed by a function call --> cgaal-engine/src/game_structure/lcgs/symbol_checker.rs:336:14 | 336 | .ok_or(SpannedError::new( | ______________^ 337 | | *span, 338 | | format!("Unknown declaration '{}'.", oi), 339 | | ))?; | |______________^ | = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#or_fun_call help: try this | 336 ~ .ok_or_else(|| SpannedError::new( 337 + *span, 338 + format!("Unknown declaration '{}'.", oi), 339 ~ ))?; |
use of `ok_or` followed by a function call: cgaal-engine/src/game_structure/lcgs/symbol_checker.rs#L322
warning: use of `ok_or` followed by a function call --> cgaal-engine/src/game_structure/lcgs/symbol_checker.rs:322:18 | 322 | .ok_or(SpannedError::new( | __________________^ 323 | | player_name.span, 324 | | format!("Unknown player '{}'.", player_name.text), 325 | | ))?; | |__________________^ | = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#or_fun_call help: try this | 322 ~ .ok_or_else(|| SpannedError::new( 323 + player_name.span, 324 + format!("Unknown player '{}'.", player_name.text), 325 ~ ))?; |
use of `or` followed by a function call: cgaal-engine/src/game_structure/lcgs/symbol_checker.rs#L313
warning: use of `or` followed by a function call --> cgaal-engine/src/game_structure/lcgs/symbol_checker.rs:313:30 | 313 | oi.owner.clone().or(self.scope_owner.clone()), | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: try this: `or_else(|| self.scope_owner.clone())` | = note: `#[warn(clippy::or_fun_call)]` on by default = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#or_fun_call
this expression creates a reference which is immediately dereferenced by the compiler: cgaal-engine/src/algorithms/certain_zero/search_strategy/linear_representative_search.rs#L124
warning: this expression creates a reference which is immediately dereferenced by the compiler --> cgaal-engine/src/algorithms/certain_zero/search_strategy/linear_representative_search.rs:124:58 | 124 | dist += (state.0[&state_var] - rep.0[&state_var]).unsigned_abs(); | ^^^^^^^^^^ help: change this to: `state_var` | = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_borrow
this expression creates a reference which is immediately dereferenced by the compiler: cgaal-engine/src/algorithms/certain_zero/search_strategy/linear_representative_search.rs#L124
warning: this expression creates a reference which is immediately dereferenced by the compiler --> cgaal-engine/src/algorithms/certain_zero/search_strategy/linear_representative_search.rs:124:38 | 124 | dist += (state.0[&state_var] - rep.0[&state_var]).unsigned_abs(); | ^^^^^^^^^^ help: change this to: `state_var` | = note: `#[warn(clippy::needless_borrow)]` on by default = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_borrow
Clippy (1.65.0)
Node.js 16 actions are deprecated. Please update the following actions to use Node.js 20: actions/checkout@v3, actions-rs/toolchain@v1, actions-rs/clippy-check@v1. For more information see: https://github.blog/changelog/2023-09-22-github-actions-transitioning-from-node-16-to-node-20/.
Clippy (1.65.0)
The following actions uses node12 which is deprecated and will be forced to run on node16: actions-rs/toolchain@v1, actions-rs/clippy-check@v1. For more info: https://github.blog/changelog/2023-06-13-github-actions-all-actions-will-run-on-node16-instead-of-node12-by-default/
Clippy (1.65.0)
The `set-output` command is deprecated and will be disabled soon. Please upgrade to using Environment Files. For more information see: https://github.blog/changelog/2022-10-11-github-actions-deprecating-save-state-and-set-output-commands/
Clippy (1.65.0)
The `set-output` command is deprecated and will be disabled soon. Please upgrade to using Environment Files. For more information see: https://github.blog/changelog/2022-10-11-github-actions-deprecating-save-state-and-set-output-commands/
Clippy (1.65.0)
The `set-output` command is deprecated and will be disabled soon. Please upgrade to using Environment Files. For more information see: https://github.blog/changelog/2022-10-11-github-actions-deprecating-save-state-and-set-output-commands/
Clippy (1.65.0)
The `set-output` command is deprecated and will be disabled soon. Please upgrade to using Environment Files. For more information see: https://github.blog/changelog/2022-10-11-github-actions-deprecating-save-state-and-set-output-commands/
Check (1.65.0)
Node.js 16 actions are deprecated. Please update the following actions to use Node.js 20: actions/checkout@v3, actions-rs/toolchain@v1, actions-rs/cargo@v1. For more information see: https://github.blog/changelog/2023-09-22-github-actions-transitioning-from-node-16-to-node-20/.
Check (1.65.0)
The following actions uses node12 which is deprecated and will be forced to run on node16: actions-rs/toolchain@v1, actions-rs/cargo@v1. For more info: https://github.blog/changelog/2023-06-13-github-actions-all-actions-will-run-on-node16-instead-of-node12-by-default/
Check (1.65.0)
The `set-output` command is deprecated and will be disabled soon. Please upgrade to using Environment Files. For more information see: https://github.blog/changelog/2022-10-11-github-actions-deprecating-save-state-and-set-output-commands/
Check (1.65.0)
The `set-output` command is deprecated and will be disabled soon. Please upgrade to using Environment Files. For more information see: https://github.blog/changelog/2022-10-11-github-actions-deprecating-save-state-and-set-output-commands/
Check (1.65.0)
The `set-output` command is deprecated and will be disabled soon. Please upgrade to using Environment Files. For more information see: https://github.blog/changelog/2022-10-11-github-actions-deprecating-save-state-and-set-output-commands/
Check (1.65.0)
The `set-output` command is deprecated and will be disabled soon. Please upgrade to using Environment Files. For more information see: https://github.blog/changelog/2022-10-11-github-actions-deprecating-save-state-and-set-output-commands/