Skip to content

added workshop resources for the seminar about ddo held at UCLouvain … #296

added workshop resources for the seminar about ddo held at UCLouvain …

added workshop resources for the seminar about ddo held at UCLouvain … #296

GitHub Actions / clippy succeeded Nov 30, 2023 in 2s

clippy

59 warnings

Details

Results

Message level Amount
Internal compiler error 0
Error 0
Warning 59
Note 0
Help 0

Versions

  • rustc 1.73.0 (cc66ad468 2023-10-03)
  • cargo 1.73.0 (9c4383fb5 2023-08-26)
  • clippy 0.1.73 (cc66ad4 2023-10-03)

Annotations

Check warning on line 50 in ddo/examples/tsptw/heuristics.rs

See this annotation in the file changed.

@github-actions 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

See this annotation in the file changed.

@github-actions 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

See this annotation in the file changed.

@github-actions 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

See this annotation in the file changed.

@github-actions 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

See this annotation in the file changed.

@github-actions 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

See this annotation in the file changed.

@github-actions 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

See this annotation in the file changed.

@github-actions 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

See this annotation in the file changed.

@github-actions 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

See this annotation in the file changed.

@github-actions 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

See this annotation in the file changed.

@github-actions 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 185 in ddo/src/implementation/mdd/pooled.rs

See this annotation in the file changed.

@github-actions 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

See this annotation in the file changed.

@github-actions 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

See this annotation in the file changed.

@github-actions 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

See this annotation in the file changed.

@github-actions 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

See this annotation in the file changed.

@github-actions 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 88 in ddo/examples/srflp/io_utils.rs

See this annotation in the file changed.

@github-actions github-actions / clippy

the loop variable `i` is only used to index `lengths`

warning: the loop variable `i` is only used to index `lengths`
  --> ddo/examples/srflp/io_utils.rs:88:18
   |
88 |         for i in 0..nb_departments {
   |                  ^^^^^^^^^^^^^^^^^
   |
   = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_range_loop
help: consider using an iterator
   |
88 |         for <item> in lengths.iter_mut().take(nb_departments) {
   |             ~~~~~~    ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

Check warning on line 177 in ddo/examples/srflp/relax.rs

See this annotation in the file changed.

@github-actions github-actions / clippy

the loop variable `i` is used to index `lengths`

warning: the loop variable `i` is used to index `lengths`
   --> ddo/examples/srflp/relax.rs:177:18
    |
177 |         for i in 0..(complete_arrangement-1) {
    |                  ^^^^^^^^^^^^^^^^^^^^^^^^^^^
    |
    = 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()
    |
177 |         for (i, <item>) in lengths.iter().enumerate().take((complete_arrangement-1)) {
    |             ~~~~~~~~~~~    ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

Check warning on line 102 in ddo/examples/srflp/model.rs

See this annotation in the file changed.

@github-actions github-actions / clippy

using `clone` on type `Option<Set64>` which implements the `Copy` trait

warning: using `clone` on type `Option<Set64>` which implements the `Copy` trait
   --> ddo/examples/srflp/model.rs:102:26
    |
102 |         let mut maybes = state.maybe_place.clone();
    |                          ^^^^^^^^^^^^^^^^^^^^^^^^^ help: try removing the `clone` call: `state.maybe_place`
    |
    = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#clone_on_copy

Check warning on line 99 in ddo/examples/srflp/model.rs

See this annotation in the file changed.

@github-actions github-actions / clippy

using `clone` on type `Set64` which implements the `Copy` trait

warning: using `clone` on type `Set64` which implements the `Copy` trait
  --> ddo/examples/srflp/model.rs:99:29
   |
99 |         let mut remaining = state.must_place.clone();
   |                             ^^^^^^^^^^^^^^^^^^^^^^^^ help: try removing the `clone` call: `state.must_place`
   |
   = 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 192 in ddo/src/implementation/mdd/clean.rs

See this annotation in the file changed.

@github-actions 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

See this annotation in the file changed.

@github-actions 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

See this annotation in the file changed.

@github-actions 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

See this annotation in the file changed.

@github-actions 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

See this annotation in the file changed.

@github-actions 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

See this annotation in the file changed.

@github-actions 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