update the latest cells #297
clippy
59 warnings
Details
Results
Message level | Amount |
---|---|
Internal compiler error | 0 |
Error | 0 |
Warning | 59 |
Note | 0 |
Help | 0 |
Versions
- rustc 1.74.0 (79e9716c9 2023-11-13)
- cargo 1.74.0 (ecb9851af 2023-10-18)
- clippy 0.1.74 (79e9716 2023-11-13)
Annotations
Check warning on line 185 in ddo/src/implementation/mdd/pooled.rs
github-actions / clippy
try not to call a closure in the expression where it is declared
warning: try not to call a closure in the expression where it is declared
--> ddo/src/implementation/mdd/pooled.rs:185:13
|
185 | $action(edge);
| ^^^^^^^^^^^^^
...
883 | / foreach!(edge of NodeId(id), self, |edge: Edge| {
884 | | let Edge{from, to, decision, cost} = edge;
885 | | let best = get!(node NodeId(id), self).best;
886 | | let best = best.map(|eid| *get!(edge eid, self));
887 | | out.push_str(&Self::edge(from.0, to.0, decision, cost, Some(edge) == best));
888 | | });
| |__________- in this macro invocation
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#redundant_closure_call
= note: this warning originates in the macro `foreach` (in Nightly builds, run with -Z macro-backtrace for more info)
Check warning on line 185 in ddo/src/implementation/mdd/pooled.rs
github-actions / clippy
try not to call a closure in the expression where it is declared
warning: try not to call a closure in the expression where it is declared
--> ddo/src/implementation/mdd/pooled.rs:185:13
|
185 | $action(edge);
| ^^^^^^^^^^^^^
...
798 | / foreach!(edge of drop_id, self, |edge: Edge| {
799 | | let src = get!(node edge.from, self).state.as_ref();
800 | | let dst = get!(node edge.to, self).state.as_ref();
801 | | let rcost = input.relaxation.relax(src, dst, merged.as_ref(), edge.decision, edge.cost);
... |
808 | | });
809 | | });
| |______________- in this macro invocation
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#redundant_closure_call
= note: this warning originates in the macro `foreach` (in Nightly builds, run with -Z macro-backtrace for more info)
Check warning on line 185 in ddo/src/implementation/mdd/pooled.rs
github-actions / clippy
try not to call a closure in the expression where it is declared
warning: try not to call a closure in the expression where it is declared
--> ddo/src/implementation/mdd/pooled.rs:185:13
|
185 | $action(edge);
| ^^^^^^^^^^^^^
...
545 | / foreach!(edge of id, self, |edge: Edge| {
546 | | let parent = get!(mut node edge.from, self);
547 | | if parent.flags.is_exact() && !parent.flags.is_cutset() {
548 | | if !self.is_exact {
... |
552 | | }
553 | | });
| |__________________________- in this macro invocation
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#redundant_closure_call
= note: this warning originates in the macro `foreach` (in Nightly builds, run with -Z macro-backtrace for more info)
Check warning on line 185 in ddo/src/implementation/mdd/pooled.rs
github-actions / clippy
try not to call a closure in the expression where it is declared
warning: try not to call a closure in the expression where it is declared
--> ddo/src/implementation/mdd/pooled.rs:185:13
|
185 | $action(edge);
| ^^^^^^^^^^^^^
...
511 | / foreach!(edge of id, self, |edge: Edge| {
512 | | let parent = get!(mut node edge.from, self);
513 | | let theta = parent.theta.unwrap_or(isize::MAX);
514 | | parent.theta = Some(theta.min(my_theta.saturating_sub(edge.cost)));
515 | | });
| |__________________________- in this macro invocation
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#redundant_closure_call
= note: this warning originates in the macro `foreach` (in Nightly builds, run with -Z macro-backtrace for more info)
Check warning on line 185 in ddo/src/implementation/mdd/pooled.rs
github-actions / clippy
try not to call a closure in the expression where it is declared
warning: try not to call a closure in the expression where it is declared
--> ddo/src/implementation/mdd/pooled.rs:185:13
|
185 | $action(edge);
| ^^^^^^^^^^^^^
...
454 | / foreach!(edge of id, self, |edge: Edge| {
455 | | let using_edge = value.saturating_add(edge.cost);
456 | | let parent = get!(mut node edge.from, self);
457 | | parent.flags.set_marked(true);
458 | | parent.value_bot = parent.value_bot.max(using_edge);
459 | | });
| |__________________________- in this macro invocation
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#redundant_closure_call
= note: this warning originates in the macro `foreach` (in Nightly builds, run with -Z macro-backtrace for more info)
Check warning on line 50 in ddo/examples/tsptw/heuristics.rs
github-actions / clippy
casting to the same type is unnecessary (`usize` -> `usize`)
warning: casting to the same type is unnecessary (`usize` -> `usize`)
--> ddo/examples/tsptw/heuristics.rs:50:25
|
50 | self.nb_vars * (state.depth as usize + 1) * self.factor
| ^^^^^^^^^^^^^^^^^^^^ help: try: `state.depth`
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#unnecessary_cast
Check warning on line 153 in ddo/examples/tsptw/relax.rs
github-actions / clippy
using `clone` on type `Set256` which implements the `Copy` trait
warning: using `clone` on type `Set256` which implements the `Copy` trait
--> ddo/examples/tsptw/relax.rs:153:25
|
153 | let mut maybe = self.all_maybe.clone(); // three lines: faster because it is in-place
| ^^^^^^^^^^^^^^^^^^^^^^ help: try removing the `clone` call: `self.all_maybe`
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#clone_on_copy
Check warning on line 150 in ddo/examples/tsptw/relax.rs
github-actions / clippy
using `clone` on type `Set256` which implements the `Copy` trait
warning: using `clone` on type `Set256` which implements the `Copy` trait
--> ddo/examples/tsptw/relax.rs:150:9
|
150 | self.all_agree.clone()
| ^^^^^^^^^^^^^^^^^^^^^^ help: try removing the `clone` call: `self.all_agree`
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#clone_on_copy
Check warning on line 135 in ddo/examples/tsptw/relax.rs
github-actions / clippy
using `clone` on type `Set256` which implements the `Copy` trait
warning: using `clone` on type `Set256` which implements the `Copy` trait
--> ddo/examples/tsptw/relax.rs:135:27
|
135 | Position::Virtual(self.position.clone())
| ^^^^^^^^^^^^^^^^^^^^^ help: try removing the `clone` call: `self.position`
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#clone_on_copy
Check warning on line 212 in ddo/examples/tsptw/model.rs
github-actions / clippy
casting to the same type is unnecessary (`usize` -> `usize`)
warning: casting to the same type is unnecessary (`usize` -> `usize`)
--> ddo/examples/tsptw/model.rs:212:66
|
212 | .map(|i| self.instance.distances[i as usize][j as usize])
| ^^^^^^^^^^ help: try: `j`
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#unnecessary_cast
Check warning on line 212 in ddo/examples/tsptw/model.rs
github-actions / clippy
casting to the same type is unnecessary (`usize` -> `usize`)
warning: casting to the same type is unnecessary (`usize` -> `usize`)
--> ddo/examples/tsptw/model.rs:212:54
|
212 | .map(|i| self.instance.distances[i as usize][j as usize])
| ^^^^^^^^^^ help: try: `i`
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#unnecessary_cast
Check warning on line 202 in ddo/examples/tsptw/model.rs
github-actions / clippy
casting to the same type is unnecessary (`usize` -> `usize`)
warning: casting to the same type is unnecessary (`usize` -> `usize`)
--> ddo/examples/tsptw/model.rs:202:66
|
202 | .map(|i| self.instance.distances[i as usize][j as usize])
| ^^^^^^^^^^ help: try: `j`
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#unnecessary_cast
Check warning on line 202 in ddo/examples/tsptw/model.rs
github-actions / clippy
casting to the same type is unnecessary (`usize` -> `usize`)
warning: casting to the same type is unnecessary (`usize` -> `usize`)
--> ddo/examples/tsptw/model.rs:202:54
|
202 | .map(|i| self.instance.distances[i as usize][j as usize])
| ^^^^^^^^^^ help: try: `i`
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#unnecessary_cast
= note: `#[warn(clippy::unnecessary_cast)]` on by default
Check warning on line 100 in ddo/examples/tsptw/model.rs
github-actions / clippy
using `clone` on type `Option<Set256>` which implements the `Copy` trait
warning: using `clone` on type `Option<Set256>` which implements the `Copy` trait
--> ddo/examples/tsptw/model.rs:100:26
|
100 | let mut maybes = state.maybe_visit.clone();
| ^^^^^^^^^^^^^^^^^^^^^^^^^ help: try removing the `clone` call: `state.maybe_visit`
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#clone_on_copy
Check warning on line 97 in ddo/examples/tsptw/model.rs
github-actions / clippy
using `clone` on type `Set256` which implements the `Copy` trait
warning: using `clone` on type `Set256` which implements the `Copy` trait
--> ddo/examples/tsptw/model.rs:97:29
|
97 | let mut remaining = state.must_visit.clone();
| ^^^^^^^^^^^^^^^^^^^^^^^^ help: try removing the `clone` call: `state.must_visit`
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#clone_on_copy
= note: `#[warn(clippy::clone_on_copy)]` on by default
Check warning on line 81 in ddo/examples/talentsched/io_utils.rs
github-actions / clippy
you seem to be trying to use `match` for destructuring a single pattern. Consider using `if let`
warning: you seem to be trying to use `match` for destructuring a single pattern. Consider using `if let`
--> ddo/examples/talentsched/io_utils.rs:75:13
|
75 | / match data.next() {
76 | | Some(val) => {
77 | | nb_actors = val.parse()?;
78 | | i += 1;
79 | | },
80 | | None => (),
81 | | }
| |_____________^
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#single_match
= note: `#[warn(clippy::single_match)]` on by default
help: try
|
75 ~ if let Some(val) = data.next() {
76 + nb_actors = val.parse()?;
77 + i += 1;
78 + }
|
Check warning on line 47 in ddo/examples/talentsched/model.rs
github-actions / clippy
the loop variable `j` is used to index `actors`
warning: the loop variable `j` is used to index `actors`
--> ddo/examples/talentsched/model.rs:47:22
|
47 | for j in 0..instance.nb_scenes {
| ^^^^^^^^^^^^^^^^^^^^^
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_range_loop
= note: `#[warn(clippy::needless_range_loop)]` on by default
help: consider using an iterator and enumerate()
|
47 | for (j, <item>) in actors.iter_mut().enumerate().take(instance.nb_scenes) {
| ~~~~~~~~~~~ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Check warning on line 192 in ddo/src/implementation/mdd/clean.rs
github-actions / clippy
try not to call a closure in the expression where it is declared
warning: try not to call a closure in the expression where it is declared
--> ddo/src/implementation/mdd/clean.rs:192:13
|
192 | $action(edge);
| ^^^^^^^^^^^^^
...
963 | / foreach!(edge of NodeId(id), self, |edge: Edge| {
964 | | let Edge{from, to, decision, cost} = edge;
965 | | let best = get!(node NodeId(id), self).best;
966 | | let best = best.map(|eid| *get!(edge eid, self));
967 | | out.push_str(&Self::edge(from.0, to.0, decision, cost, Some(edge) == best));
968 | | });
| |__________- in this macro invocation
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#redundant_closure_call
= note: this warning originates in the macro `foreach` (in Nightly builds, run with -Z macro-backtrace for more info)
Check warning on line 192 in ddo/src/implementation/mdd/clean.rs
github-actions / clippy
try not to call a closure in the expression where it is declared
warning: try not to call a closure in the expression where it is declared
--> ddo/src/implementation/mdd/clean.rs:192:13
|
192 | $action(edge);
| ^^^^^^^^^^^^^
...
847 | / foreach!(edge of drop_id, self, |edge: Edge| {
848 | | let src = get!(node edge.from, self).state.as_ref();
849 | | let dst = get!(node edge.to, self).state.as_ref();
850 | | let rcost = input.relaxation.relax(src, dst, merged.as_ref(), edge.decision, edge.cost);
... |
857 | | });
858 | | });
| |______________- in this macro invocation
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#redundant_closure_call
= note: this warning originates in the macro `foreach` (in Nightly builds, run with -Z macro-backtrace for more info)
Check warning on line 192 in ddo/src/implementation/mdd/clean.rs
github-actions / clippy
try not to call a closure in the expression where it is declared
warning: try not to call a closure in the expression where it is declared
--> ddo/src/implementation/mdd/clean.rs:192:13
|
192 | $action(edge);
| ^^^^^^^^^^^^^
...
593 | / foreach!(edge of id, self, |edge: Edge| {
594 | | let parent = get!(mut node edge.from, self);
595 | | if parent.flags.is_exact() && !parent.flags.is_cutset() {
596 | | self.cutset.push(edge.from);
597 | | parent.flags.set_cutset(true);
598 | | }
599 | | });
| |______________________- in this macro invocation
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#redundant_closure_call
= note: this warning originates in the macro `foreach` (in Nightly builds, run with -Z macro-backtrace for more info)
Check warning on line 192 in ddo/src/implementation/mdd/clean.rs
github-actions / clippy
try not to call a closure in the expression where it is declared
warning: try not to call a closure in the expression where it is declared
--> ddo/src/implementation/mdd/clean.rs:192:13
|
192 | $action(edge);
| ^^^^^^^^^^^^^
...
521 | / foreach!(edge of id, self, |edge: Edge| {
522 | | let parent = get!(mut node edge.from, self);
523 | | let theta = parent.theta.unwrap_or(isize::MAX);
524 | | parent.theta = Some(theta.min(my_theta.saturating_sub(edge.cost)));
525 | | });
| |__________________________- in this macro invocation
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#redundant_closure_call
= note: this warning originates in the macro `foreach` (in Nightly builds, run with -Z macro-backtrace for more info)
Check warning on line 192 in ddo/src/implementation/mdd/clean.rs
github-actions / clippy
try not to call a closure in the expression where it is declared
warning: try not to call a closure in the expression where it is declared
--> ddo/src/implementation/mdd/clean.rs:192:13
|
192 | $action(edge);
| ^^^^^^^^^^^^^
...
464 | / foreach!(edge of id, self, |edge: Edge| {
465 | | let using_edge = value.saturating_add(edge.cost);
466 | | let parent = get!(mut node edge.from, self);
467 | | parent.flags.set_marked(true);
468 | | parent.value_bot = parent.value_bot.max(using_edge);
469 | | });
| |__________________________- in this macro invocation
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#redundant_closure_call
= note: `#[warn(clippy::redundant_closure_call)]` on by default
= note: this warning originates in the macro `foreach` (in Nightly builds, run with -Z macro-backtrace for more info)
Check warning on line 91 in ddo/examples/sop/io_utils.rs
github-actions / clippy
casting to the same type is unnecessary (`usize` -> `usize`)
warning: casting to the same type is unnecessary (`usize` -> `usize`)
--> ddo/examples/sop/io_utils.rs:91:21
|
91 | let i = (lc - 1) as usize;
| ^^^^^^^^^^^^^^^^^ help: try: `(lc - 1)`
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#unnecessary_cast
Check warning on line 46 in ddo/examples/sop/heuristics.rs
github-actions / clippy
casting to the same type is unnecessary (`usize` -> `usize`)
warning: casting to the same type is unnecessary (`usize` -> `usize`)
--> ddo/examples/sop/heuristics.rs:46:25
|
46 | self.nb_vars * (state.depth as usize + 1) * self.factor
| ^^^^^^^^^^^^^^^^^^^^ help: try: `state.depth`
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#unnecessary_cast
Check warning on line 139 in ddo/examples/sop/relax.rs
github-actions / clippy
casting to the same type is unnecessary (`usize` -> `usize`)
warning: casting to the same type is unnecessary (`usize` -> `usize`)
--> ddo/examples/sop/relax.rs:139:28
|
139 | let n_must_visit = state.must_schedule.len() as usize;
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: try: `state.must_schedule.len()`
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#unnecessary_cast