Finally updated doc #32
Annotations
2 errors and 128 warnings
redundant redefinition of a binding `c`:
src/machine.rs#L279
error: redundant redefinition of a binding `c`
--> src/machine.rs:279:33
|
279 | ... let c = c;
| ^^^^^^^^^^
|
help: `c` is initially defined here
--> src/machine.rs:278:41
|
278 | ... if let Some(c) = self.color {
| ^
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#redundant_locals
= note: `#[deny(clippy::redundant_locals)]` on by default
|
build
Clippy had exited with the 101 exit code
|
call to `.clone()` on a reference in this situation does nothing:
src/tools.rs#L56
warning: call to `.clone()` on a reference in this situation does nothing
--> src/tools.rs:56:52
|
56 | vec.iter().for_each(|k| res.push(vec![k.clone()]));
| ^^^^^^^^ help: remove this redundant call
|
= note: the type `K` does not implement `Clone`, so calling `clone` on `&K` copies the reference, which does not do anything and can be removed
= note: `#[warn(noop_method_call)]` on by default
|
useless use of `vec!`:
src/multipattern.rs#L69
warning: useless use of `vec!`
--> src/multipattern.rs:69:80
|
69 | let program = machine::Program::compile_from_multi_pat(&asts, &vec![], &vec![]);
| ^^^^^^^ help: you can use a slice directly: `&[]`
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#useless_vec
= note: `#[warn(clippy::useless_vec)]` on by default
|
unnecessary closure used with `bool::then`:
src/multipattern.rs#L188
warning: unnecessary closure used with `bool::then`
--> src/multipattern.rs:188:9
|
188 | (!matches.matches.is_empty()).then(|| matches)
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^----------------
| |
| help: use `then_some(..)` instead: `then_some(matches)`
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#unnecessary_lazy_evaluations
|
all variants have the same postfix: `Error`:
src/multipattern.rs#L97
warning: all variants have the same postfix: `Error`
--> src/multipattern.rs:97:1
|
97 | / pub enum MultiPatternParseError<E> {
98 | | /// One of the patterns in the multipattern failed to parse.
99 | | #[error(transparent)]
100 | | PatternParseError(E),
... |
106 | | VariableError(<Var as FromStr>::Err),
107 | | }
| |_^
|
= help: remove the postfixes and use full paths to the variants instead of glob imports
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#enum_variant_names
= note: `#[warn(clippy::enum_variant_names)]` on by default
|
length comparison to zero:
src/multipattern.rs#L85
warning: length comparison to zero
--> src/multipattern.rs:85:16
|
85 | if p2_holes.len() == 0 {
| ^^^^^^^^^^^^^^^^^^^ help: using `is_empty` is clearer and more explicit: `p2_holes.is_empty()`
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#len_zero
|
length comparison to zero:
src/multipattern.rs#L81
warning: length comparison to zero
--> src/multipattern.rs:81:16
|
81 | if p_holes.len() == 0 {
| ^^^^^^^^^^^^^^^^^^ help: using `is_empty` is clearer and more explicit: `p_holes.is_empty()`
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#len_zero
|
deref which would be done by auto-deref:
src/colored_union_find.rs#L168
warning: deref which would be done by auto-deref
--> src/colored_union_find.rs:168:37
|
168 | .filter(|k| load_id(*k) as usize == t_i)
| ^^ help: try: `k`
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#explicit_auto_deref
= note: `#[warn(clippy::explicit_auto_deref)]` on by default
|
unneeded `return` statement:
src/colored_union_find.rs#L148
warning: unneeded `return` statement
--> src/colored_union_find.rs:148:9
|
148 | return Some((*x_res, *y_res));
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_return
help: remove `return`
|
148 - return Some((*x_res, *y_res));
148 + Some((*x_res, *y_res))
|
|
called `map(..).flatten()` on `Option`:
src/colored_union_find.rs#L128
warning: called `map(..).flatten()` on `Option`
--> src/colored_union_find.rs:128:14
|
128 | .map(|x| self.translation.get_by_right(&x)).flatten().copied()
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: try replacing `map` with `and_then` and remove the `.flatten()`: `and_then(|x| self.translation.get_by_right(&x))`
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#map_flatten
|
unneeded `return` statement:
src/tools.rs#L45
warning: unneeded `return` statement
--> src/tools.rs:45:9
|
45 | return res;
| ^^^^^^^^^^
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_return
help: remove `return`
|
45 - return res;
45 + res
|
|
module has the same name as its containing module:
src/tools.rs#L1
warning: module has the same name as its containing module
--> src/tools.rs:1:1
|
1 | / pub mod tools {
2 | | use std::collections::hash_map::RandomState;
3 | | use std::hash::Hash;
... |
109 | | }
110 | | }
| |_^
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#module_inception
= note: `#[warn(clippy::module_inception)]` on by default
|
question mark operator is useless here:
src/eggstentions/tree.rs#L170
warning: question mark operator is useless here
--> src/eggstentions/tree.rs:170:9
|
170 | Ok(parse_sexp_tree(&sexp)?)
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: try removing question mark and `Ok()`: `parse_sexp_tree(&sexp)`
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_question_mark
= note: `#[warn(clippy::needless_question_mark)]` on by default
|
unnecessary closure used with `bool::then`:
src/eggstentions/tree.rs#L110
warning: unnecessary closure used with `bool::then`
--> src/eggstentions/tree.rs:110:25
|
110 | rec_res.is_eq().then(|| rec_res)
| ^^^^^^^^^^^^^^^^----------------
| |
| help: use `then_some(..)` instead: `then_some(rec_res)`
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#unnecessary_lazy_evaluations
|
methods called `into_*` usually take `self` by value:
src/eggstentions/expression_ops.rs#L116
warning: methods called `into_*` usually take `self` by value
--> src/eggstentions/expression_ops.rs:116:18
|
116 | fn into_tree(&'a self) -> RecExpSlice<'a, T>;
| ^^^^^^^^
|
= help: consider choosing a less ambiguous name
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#wrong_self_convention
= note: `#[warn(clippy::wrong_self_convention)]` on by default
|
an implementation of `From` is preferred since it gives you `Into<_>` for free where the reverse isn't true:
src/eggstentions/expression_ops.rs#L107
warning: an implementation of `From` is preferred since it gives you `Into<_>` for free where the reverse isn't true
--> src/eggstentions/expression_ops.rs:107:1
|
107 | impl<'a, L: Language> Into<RecExpr<L>> for RecExpSlice<'a, L> {
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#from_over_into
help: replace the `Into` implementation with `From<eggstentions::expression_ops::RecExpSlice<'a, L>>`
|
107 ~ impl<'a, L: Language> From<RecExpSlice<'a, L>> for RecExpr<L> {
108 ~ fn from(val: RecExpSlice<'a, L>) -> Self {
109 ~ RecExpr::from(val.exp.as_ref()[..val.index + 1].iter().cloned().collect_vec())
|
|
you seem to be trying to pop elements from a `Vec` in a loop:
src/eggstentions/expression_ops.rs#L91
warning: you seem to be trying to pop elements from a `Vec` in a loop
--> src/eggstentions/expression_ops.rs:91:13
|
91 | let current = nodes.pop().unwrap();
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#manual_while_let_some
help: consider using a `while..let` loop
|
90 ~ while let Some(current) = nodes.pop() {
91 ~
|
|
the following explicit lifetimes could be elided: 'a:
src/eggstentions/expression_ops.rs#L49
warning: the following explicit lifetimes could be elided: 'a
--> src/eggstentions/expression_ops.rs:49:23
|
49 | fn add_to_exp<'a, L: Language>(expr: &mut Vec<L>, child: &RecExpSlice<'a, L>) -> Id {
| ^^ ^^
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_lifetimes
help: elide the lifetimes
|
49 - fn add_to_exp<'a, L: Language>(expr: &mut Vec<L>, child: &RecExpSlice<'a, L>) -> Id {
49 + fn add_to_exp<L: Language>(expr: &mut Vec<L>, child: &RecExpSlice<'_, L>) -> Id {
|
|
`to_string` applied to a type that implements `Display` in `format!` args:
src/eggstentions/expression_ops.rs#L42
warning: `to_string` applied to a type that implements `Display` in `format!` args
--> src/eggstentions/expression_ops.rs:42:56
|
42 | format!("({} {})", self.root().display_op().to_string(),
| ^^^^^^^^^^^^ help: remove this
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#to_string_in_format_args
|
`to_string` applied to a type that implements `Display` in `format!` args:
src/eggstentions/expression_ops.rs#L40
warning: `to_string` applied to a type that implements `Display` in `format!` args
--> src/eggstentions/expression_ops.rs:40:51
|
40 | format!("{}", self.root().display_op().to_string())
| ^^^^^^^^^^^^ help: remove this
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#to_string_in_format_args
|
useless use of `format!`:
src/eggstentions/expression_ops.rs#L40
warning: useless use of `format!`
--> src/eggstentions/expression_ops.rs:40:13
|
40 | format!("{}", self.root().display_op().to_string())
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: consider using `.to_string()`: `self.root().display_op().to_string()`
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#useless_format
= note: `#[warn(clippy::useless_format)]` on by default
|
non-canonical implementation of `partial_cmp` on an `Ord` type:
src/eggstentions/costs.rs#L37
warning: non-canonical implementation of `partial_cmp` on an `Ord` type
--> src/eggstentions/costs.rs:37:1
|
37 | / impl PartialOrd for RepOrder {
38 | | fn partial_cmp(&self, other: &Self) -> Option<Ordering> {
| | _____________________________________________________________-
39 | || match self.size.partial_cmp(&other.size) {
40 | || None => { other.compare_vars(self) }
41 | || Some(x) => {
... ||
48 | || }
49 | || }
| ||_____- help: change this to: `{ Some(self.cmp(other)) }`
50 | | }
| |__^
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#non_canonical_partial_ord_impl
= note: `#[warn(clippy::non_canonical_partial_ord_impl)]` on by default
|
writing `&Vec` instead of `&[_]` involves a new object where a slice will do:
src/eggstentions/costs.rs#L20
warning: writing `&Vec` instead of `&[_]` involves a new object where a slice will do
--> src/eggstentions/costs.rs:20:22
|
20 | fn count_ph1(it: &Vec<String>) -> usize {
| ^^^^^^^^^^^^ help: change this to: `&[String]`
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#ptr_arg
|
called `unwrap` on `color` after checking its variant with `is_some`:
src/eggstentions/reconstruct.rs#L110
warning: called `unwrap` on `color` after checking its variant with `is_some`
--> src/eggstentions/reconstruct.rs:110:41
|
109 | let fixed_n = if color.is_some() {
| ------------------ help: try: `if let Some(..) = &color`
110 | graph.colored_canonize(*color.as_ref().unwrap(), n)
| ^^^^^^^^^^^^^^^^^^^^^^^
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#unnecessary_unwrap
= note: `#[warn(clippy::unnecessary_unwrap)]` on by default
|
this expression creates a reference which is immediately dereferenced by the compiler:
src/eggstentions/reconstruct.rs#L70
warning: this expression creates a reference which is immediately dereferenced by the compiler
--> src/eggstentions/reconstruct.rs:70:24
|
70 | inner_ids.push(&edge);
| ^^^^^ help: change this to: `edge`
|
= 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:
src/eggstentions/reconstruct.rs#L67
warning: this expression creates a reference which is immediately dereferenced by the compiler
--> src/eggstentions/reconstruct.rs:67:59
|
67 | build_translation(graph, color, translations, &edge, class);
| ^^^^^ help: change this to: `edge`
|
= 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:
src/eggstentions/reconstruct.rs#L58
warning: this expression creates a reference which is immediately dereferenced by the compiler
--> src/eggstentions/reconstruct.rs:58:59
|
58 | build_translation(graph, color, translations, &edge, class);
| ^^^^^ help: change this to: `edge`
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_borrow
|
called `is_some()` after searching an `Iterator` with `find`:
src/eggstentions/reconstruct.rs#L57
warning: called `is_some()` after searching an `Iterator` with `find`
--> src/eggstentions/reconstruct.rs:57:48
|
57 | x.equality_class(graph, class).find(|id| translations.contains_key(id)).is_some()))) {
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: consider using: `any(|id| translations.contains_key(&id))`
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#search_is_some
|
this expression creates a reference which is immediately dereferenced by the compiler:
src/eggstentions/reconstruct.rs#L45
warning: this expression creates a reference which is immediately dereferenced by the compiler
--> src/eggstentions/reconstruct.rs:45:77
|
45 | check_class(graph, color, id, translations, &mut inner_ids, &colorded_class)
| ^^^^^^^^^^^^^^^ help: change this to: `colorded_class`
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_borrow
|
called `map(f)` on an `Option` value where `f` is a closure that returns the unit type `()`:
src/eggstentions/reconstruct.rs#L40
warning: called `map(f)` on an `Option` value where `f` is a closure that returns the unit type `()`
--> src/eggstentions/reconstruct.rs:40:5
|
40 | // color.map(|c| {
41 | || if let Some(x) = graph.get_color(c) {
42 | || let ids = x.equality_class(graph, class);
43 | || for id in ids {
... ||
47 | || }
48 | || });
| ||______^- help: try: `if let Some(c) = color { ... }`
| |______|
|
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#option_map_unit_fn
= note: `#[warn(clippy::option_map_unit_fn)]` on by default
|
this expression creates a reference which is immediately dereferenced by the compiler:
src/eggstentions/reconstruct.rs#L39
warning: this expression creates a reference which is immediately dereferenced by the compiler
--> src/eggstentions/reconstruct.rs:39:68
|
39 | check_class(graph, color, class, translations, &mut inner_ids, &cur_class);
| ^^^^^^^^^^ help: change this to: `cur_class`
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_borrow
|
you are using an explicit closure for cloning elements:
src/eggstentions/reconstruct.rs#L29
warning: you are using an explicit closure for cloning elements
--> src/eggstentions/reconstruct.rs:29:5
|
29 | translations.get(&class).map(|x| x.clone())
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: consider calling the dedicated `cloned` method: `translations.get(&class).cloned()`
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#map_clone
|
this expression creates a reference which is immediately dereferenced by the compiler:
src/eggstentions/reconstruct.rs#L26
warning: this expression creates a reference which is immediately dereferenced by the compiler
--> src/eggstentions/reconstruct.rs:26:27
|
26 | reconstruct_inner(&graph, *child, max_depth - 1, None, &mut translations);
| ^^^^^^ help: change this to: `graph`
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_borrow
|
you are using an explicit closure for cloning elements:
src/eggstentions/reconstruct.rs#L19
warning: you are using an explicit closure for cloning elements
--> src/eggstentions/reconstruct.rs:19:5
|
19 | translations.get(&class).map(|x| x.clone())
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: consider calling the dedicated `cloned` method: `translations.get(&class).cloned()`
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#map_clone
= note: `#[warn(clippy::map_clone)]` on by default
|
this expression creates a reference which is immediately dereferenced by the compiler:
src/eggstentions/reconstruct.rs#L18
warning: this expression creates a reference which is immediately dereferenced by the compiler
--> src/eggstentions/reconstruct.rs:18:23
|
18 | reconstruct_inner(&graph, class, max_depth, color, &mut translations);
| ^^^^^^ help: change this to: `graph`
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_borrow
|
unneeded `return` statement:
src/colors.rs#L249
warning: unneeded `return` statement
--> src/colors.rs:249:9
|
249 | return res.into_iter().collect_vec();
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_return
help: remove `return`
|
249 - return res.into_iter().collect_vec();
249 + res.into_iter().collect_vec()
|
|
useless conversion to the same type: `indexmap::map::Keys<'_, Id, indexmap::IndexSet<Id>>`:
src/colors.rs#L235
warning: useless conversion to the same type: `indexmap::map::Keys<'_, Id, indexmap::IndexSet<Id>>`
--> src/colors.rs:235:9
|
235 | self.equality_classes.keys().into_iter()
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: consider removing `.into_iter()`: `self.equality_classes.keys()`
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#useless_conversion
= note: `#[warn(clippy::useless_conversion)]` on by default
|
unneeded `return` statement:
src/colors.rs#L192
warning: unneeded `return` statement
--> src/colors.rs:192:9
|
192 | return Default::default();
| ^^^^^^^^^^^^^^^^^^^^^^^^^
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_return
help: remove `return`
|
192 - return Default::default();
192 + Default::default()
|
|
unnecessary closure used to substitute value for `Option::None`:
src/colors.rs#L87
warning: unnecessary closure used to substitute value for `Option::None`
--> src/colors.rs:87:9
|
87 | / self.union_find.find(&fixed).unwrap_or_else(|| {
88 | | fixed
89 | | })
| |__________^
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#unnecessary_lazy_evaluations
= note: `#[warn(clippy::unnecessary_lazy_evaluations)]` on by default
help: use `unwrap_or(..)` instead
|
87 ~ self.union_find.find(&fixed).unwrap_or({
88 + fixed
89 + })
|
|
redundant closure:
src/colors.rs#L44
warning: redundant closure
--> src/colors.rs:44:42
|
44 | let parents = parent.map_or_else(|| vec![], |p| {
| ^^^^^^^^^ help: replace the closure with `Vec::new`: `std::vec::Vec::new`
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#redundant_closure
= note: `#[warn(clippy::redundant_closure)]` on by default
|
casting to the same type is unnecessary (`f64` -> `f64`):
src/test.rs#L25
warning: casting to the same type is unnecessary (`f64` -> `f64`)
--> src/test.rs:25:35
|
25 | let diff = mean - (*value as f64);
| ^^^^^^^^^^^^^^^ help: try: `{ *value }`
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#unnecessary_cast
|
casting to the same type is unnecessary (`usize` -> `usize`):
src/lib.rs#L95
warning: casting to the same type is unnecessary (`usize` -> `usize`)
--> src/lib.rs:95:9
|
95 | id.0 as usize
| ^^^^^^^^^^^^^ help: try: `id.0`
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#unnecessary_cast
|
casting to the same type is unnecessary (`usize` -> `usize`):
src/lib.rs#L89
warning: casting to the same type is unnecessary (`usize` -> `usize`)
--> src/lib.rs:89:17
|
89 | ColorId(n as usize)
| ^^^^^^^^^^ help: try: `n`
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#unnecessary_cast
|
an implementation of `From` is preferred since it gives you `Into<_>` for free where the reverse isn't true:
src/lib.rs#L69
warning: an implementation of `From` is preferred since it gives you `Into<_>` for free where the reverse isn't true
--> src/lib.rs:69:1
|
69 | impl Into<Id> for i32 {
| ^^^^^^^^^^^^^^^^^^^^^
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#from_over_into
help: replace the `Into` implementation with `From<i32>`
|
69 ~ impl From<i32> for Id {
70 ~ fn from(val: i32) -> Self {
71 ~ Id(val as u32)
|
|
an implementation of `From` is preferred since it gives you `Into<_>` for free where the reverse isn't true:
src/lib.rs#L63
warning: an implementation of `From` is preferred since it gives you `Into<_>` for free where the reverse isn't true
--> src/lib.rs:63:1
|
63 | impl Into<Id> for u32 {
| ^^^^^^^^^^^^^^^^^^^^^
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#from_over_into
= note: `#[warn(clippy::from_over_into)]` on by default
help: replace the `Into` implementation with `From<u32>`
|
63 ~ impl From<u32> for Id {
64 ~ fn from(val: u32) -> Self {
65 ~ Id(val)
|
|
called `is_none()` after searching an `Iterator` with `find`:
src/util.rs#L128
warning: called `is_none()` after searching an `Iterator` with `find`
--> src/util.rs:128:29
|
128 | assert!(strings.values().find(|&&v| v == name).is_none());
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: consider using: `!strings.values().any(|&v| v == name)`
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#search_is_some
|
using `clone` on type `Option<ColorId>` which implements the `Copy` trait:
src/subst.rs#L118
warning: using `clone` on type `Option<ColorId>` which implements the `Copy` trait
--> src/subst.rs:118:25
|
118 | new.color = sub2.color.clone();
| ^^^^^^^^^^^^^^^^^^ help: try removing the `clone` call: `sub2.color`
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#clone_on_copy
|
the following explicit lifetimes could be elided: 'a:
src/ser.rs#L160
warning: the following explicit lifetimes could be elided: 'a
--> src/ser.rs:160:29
|
160 | pub(crate) fn add_class<'a>(&'a mut self, id: Id) {
| ^^ ^^
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_lifetimes
help: elide the lifetimes
|
160 - pub(crate) fn add_class<'a>(&'a mut self, id: Id) {
160 + pub(crate) fn add_class(&mut self, id: Id) {
|
|
length comparison to zero:
src/ser.rs#L144
warning: length comparison to zero
--> src/ser.rs:144:25
|
144 | .filter(|s| s.len() > 0)
| ^^^^^^^^^^^ help: using `!is_empty` is clearer and more explicit: `!s.is_empty()`
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#len_zero
|
length comparison to zero:
src/ser.rs#L91
warning: length comparison to zero
--> src/ser.rs:91:48
|
91 | let v: Vec<_> = line.split(' ').filter(|s| s.len() > 0).collect();
| ^^^^^^^^^^^ help: using `!is_empty` is clearer and more explicit: `!s.is_empty()`
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#len_zero
|
this expression creates a reference which is immediately dereferenced by the compiler:
src/run.rs#L541
warning: this expression creates a reference which is immediately dereferenced by the compiler
--> src/run.rs:541:34
|
541 | data: IterData::make(&self),
| ^^^^^ help: change this to: `self`
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_borrow
|
use of `default` to create a unit struct:
src/run.rs#L260
warning: use of `default` to create a unit struct
--> src/run.rs:260:48
|
260 | scheduler: Box::new(SimpleScheduler::default()),
| ^^^^^^^^^^^ help: remove this call to `default`
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#default_constructed_unit_structs
= note: `#[warn(clippy::default_constructed_unit_structs)]` on by default
|
returning the result of a `let` binding from a block:
src/pattern.rs#L328
warning: returning the result of a `let` binding from a block
--> src/pattern.rs:328:9
|
327 | let sms = SearchMatches { matches };
| ------------------------------------ unnecessary `let` binding
328 | sms
| ^^^
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#let_and_return
help: return the expression directly
|
327 ~
328 ~ SearchMatches { matches }
|
|
struct `SearchMatches` has a public `len` method, but no `is_empty` method:
src/pattern.rs#L295
warning: struct `SearchMatches` has a public `len` method, but no `is_empty` method
--> src/pattern.rs:295:5
|
295 | pub fn len(&self) -> usize {
| ^^^^^^^^^^^^^^^^^^^^^^^^^^
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#len_without_is_empty
= note: `#[warn(clippy::len_without_is_empty)]` on by default
|
called `map(..).flatten()` on `Iterator`:
src/pattern.rs#L292
warning: called `map(..).flatten()` on `Iterator`
--> src/pattern.rs:292:31
|
292 | self.matches.values().map(|s| s.iter()).flatten()
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: try replacing `map` with `flat_map` and remove the `.flatten()`: `flat_map(|s| s.iter())`
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#map_flatten
= note: `#[warn(clippy::map_flatten)]` on by default
|
this lifetime isn't used in the impl:
src/pattern.rs#L229
warning: this lifetime isn't used in the impl
--> src/pattern.rs:229:6
|
229 | impl<'a, L: Language> From<PatternAst<L>> for Pattern<L> {
| ^^
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#extra_unused_lifetimes
= note: `#[warn(clippy::extra_unused_lifetimes)]` on by default
|
this `.into_iter()` call is equivalent to `.iter()` and will not consume the `slice`:
src/machine.rs#L630
warning: this `.into_iter()` call is equivalent to `.iter()` and will not consume the `slice`
--> src/machine.rs:630:45
|
630 | let mut not_patterns = not_patterns.into_iter().map(|(not_v, not_p)| {
| ^^^^^^^^^ help: call directly: `iter`
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#into_iter_on_ref
|
this `.into_iter()` call is equivalent to `.iter()` and will not consume the `Vec`:
src/machine.rs#L617
warning: this `.into_iter()` call is equivalent to `.iter()` and will not consume the `Vec`
--> src/machine.rs:617:39
|
617 | let or_patterns = or_patterns.into_iter().map(|(or_v, or_ps)| {
| ^^^^^^^^^ help: call directly: `iter`
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#into_iter_on_ref
|
using `clone` on type `Option<ColorId>` which implements the `Copy` trait:
src/machine.rs#L380
warning: using `clone` on type `Option<ColorId>` which implements the `Copy` trait
--> src/machine.rs:380:60
|
380 | return Some(Subst { vec: subst_vec, color: self.color.clone() });
| ^^^^^^^^^^^^^^^^^^ help: try removing the `clone` call: `self.color`
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#clone_on_copy
|
this `.into_iter()` call is equivalent to `.iter()` and will not consume the `slice`:
src/machine.rs#L357
warning: this `.into_iter()` call is equivalent to `.iter()` and will not consume the `slice`
--> src/machine.rs:357:50
|
357 | ... .into_iter()
| ^^^^^^^^^ help: call directly: `iter`
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#into_iter_on_ref
|
using `clone` on type `Option<ColorId>` which implements the `Copy` trait:
src/machine.rs#L348
warning: using `clone` on type `Option<ColorId>` which implements the `Copy` trait
--> src/machine.rs:348:63
|
348 | ... done.borrow_mut().insert((s.color.clone(), *s.get(*root).unwrap()));
| ^^^^^^^^^^^^^^^ help: try removing the `clone` call: `s.color`
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#clone_on_copy
|
using `clone` on type `Option<ColorId>` which implements the `Copy` trait:
src/machine.rs#L329
warning: using `clone` on type `Option<ColorId>` which implements the `Copy` trait
--> src/machine.rs:329:57
|
329 | ... if done.borrow().contains(&(machine.color.clone(), id)) || done.borrow().contains(&(None, id)) {
| ^^^^^^^^^^^^^^^^^^^^^ help: try removing the `clone` call: `machine.color`
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#clone_on_copy
|
very complex type used. Consider factoring parts into `type` definitions:
src/machine.rs#L321
warning: very complex type used. Consider factoring parts into `type` definitions
--> src/machine.rs:321:35
|
321 | let done: Rc<RefCell<BTreeSet<(Option<ColorId>, Id)>>> = Default::default();
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#type_complexity
|
you seem to be trying to pop elements from a `Vec` in a loop:
src/machine.rs#L154
warning: you seem to be trying to pop elements from a `Vec` in a loop
--> src/machine.rs:154:13
|
154 | let mut current_state = self.stack.pop().unwrap();
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#manual_while_let_some
= note: `#[warn(clippy::manual_while_let_some)]` on by default
help: consider using a `while..let` loop
|
153 ~ while let Some(mut current_state) = self.stack.pop() {
154 ~
|
|
this expression creates a reference which is immediately dereferenced by the compiler:
src/extract.rs#L240
warning: this expression creates a reference which is immediately dereferenced by the compiler
--> src/extract.rs:240:42
|
240 | Some(self.cost_function.cost(&node, cost_f))
| ^^^^^ help: change this to: `node`
|
= 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:
src/extract.rs#L166
warning: this expression creates a reference which is immediately dereferenced by the compiler
--> src/extract.rs:166:45
|
166 | (Some(a), Some(b)) => a.partial_cmp(&b).unwrap(),
| ^^ help: change this to: `b`
|
= 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:
src/egraph.rs#L2131
warning: this expression creates a reference which is immediately dereferenced by the compiler
--> src/egraph.rs:2131:36
|
2131 | .map(|n| N::make(self, &n))
| ^^ help: change this to: `n`
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_borrow
|
the following explicit lifetimes could be elided: 'a:
src/egraph.rs#L1949
warning: the following explicit lifetimes could be elided: 'a
--> src/egraph.rs:1949:29
|
1949 | pub(crate) fn add_class<'a>(&'a mut self, id: Id) {
| ^^ ^^
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_lifetimes
help: elide the lifetimes
|
1949 - pub(crate) fn add_class<'a>(&'a mut self, id: Id) {
1949 + pub(crate) fn add_class(&mut self, id: Id) {
|
|
this `.into_iter()` call is equivalent to `.iter()` and will not consume the `slice`:
src/egraph.rs#L1909
warning: this `.into_iter()` call is equivalent to `.iter()` and will not consume the `slice`
--> src/egraph.rs:1909:58
|
1909 | let mut res = self.get_colors_parents(c).into_iter().copied().collect_vec();
| ^^^^^^^^^ help: call directly: `iter`
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#into_iter_on_ref
|
this `.into_iter()` call is equivalent to `.iter()` and will not consume the `slice`:
src/egraph.rs#L1876
warning: this `.into_iter()` call is equivalent to `.iter()` and will not consume the `slice`
--> src/egraph.rs:1876:58
|
1876 | let mut res = self.get_colors_parents(c).into_iter().copied().collect_vec();
| ^^^^^^^^^ help: call directly: `iter`
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#into_iter_on_ref
|
this block may be rewritten with the `?` operator:
src/egraph.rs#L1848
warning: this block may be rewritten with the `?` operator
--> src/egraph.rs:1848:9
|
1848 | / if colors.is_none() {
1849 | | return None;
1850 | | }
| |_________^ help: replace it with: `colors?;`
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#question_mark
= note: `#[warn(clippy::question_mark)]` on by default
|
unneeded `return` statement:
src/egraph.rs#L1867
warning: unneeded `return` statement
--> src/egraph.rs:1867:9
|
1867 | / return Some(Box::new(colored_eqs.into_iter()
1868 | | .flat_map(|(c, ids)| ids.into_iter().map(move |id| (c, id)))));
| |__________________________________________________________________________^
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_return
help: remove `return`
|
1867 ~ Some(Box::new(colored_eqs.into_iter()
1868 ~ .flat_map(|(c, ids)| ids.into_iter().map(move |id| (c, id)))))
|
|
this expression creates a reference which is immediately dereferenced by the compiler:
src/egraph.rs#L1812
warning: this expression creates a reference which is immediately dereferenced by the compiler
--> src/egraph.rs:1812:49
|
1812 | self.get_color(color).unwrap().find(&self, id)
| ^^^^^ help: change this to: `self`
|
= 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:
src/egraph.rs#L1807
warning: this expression creates a reference which is immediately dereferenced by the compiler
--> src/egraph.rs:1807:45
|
1807 | self.get_color(color).unwrap().find(&self, id)
| ^^^^^ help: change this to: `self`
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_borrow
|
this `.into_iter()` call is equivalent to `.iter()` and will not consume the `slice`:
src/egraph.rs#L1781
warning: this `.into_iter()` call is equivalent to `.iter()` and will not consume the `slice`
--> src/egraph.rs:1781:76
|
1781 | let color_children = self.get_color(color).unwrap().children().into_iter().copied().collect_vec();
| ^^^^^^^^^ help: call directly: `iter`
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#into_iter_on_ref
|
replacing an `Option` with `None`:
src/egraph.rs#L1719
warning: replacing an `Option` with `None`
--> src/egraph.rs:1719:25
|
1719 | let class = std::mem::replace(&mut self.classes[black.0 as usize], None).unwrap();
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: consider `Option::take()` instead: `self.classes[black.0 as usize].take()`
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#mem_replace_option_with_none
|
replacing an `Option` with `None`:
src/egraph.rs#L1717
warning: replacing an `Option` with `None`
--> src/egraph.rs:1717:21
|
1717 | let color = std::mem::replace(&mut self.colors[c_id.0], None).unwrap();
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: consider `Option::take()` instead: `self.colors[c_id.0].take()`
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#mem_replace_option_with_none
= note: `#[warn(clippy::mem_replace_option_with_none)]` on by default
|
unneeded `return` statement:
src/egraph.rs#L1710
warning: unneeded `return` statement
--> src/egraph.rs:1710:9
|
1710 | return c_id;
| ^^^^^^^^^^^
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_return
= note: `#[warn(clippy::needless_return)]` on by default
help: remove `return`
|
1710 - return c_id;
1710 + c_id
|
|
returning the result of a `let` binding from a block:
src/egraph.rs#L1686
warning: returning the result of a `let` binding from a block
--> src/egraph.rs:1686:9
|
1685 | let new_color_id = self.create_color(Some(color));
| -------------------------------------------------- unnecessary `let` binding
1686 | new_color_id
| ^^^^^^^^^^^^
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#let_and_return
= note: `#[warn(clippy::let_and_return)]` on by default
help: return the expression directly
|
1685 ~
1686 ~ self.create_color(Some(color))
|
|
called `is_some()` after searching an `Iterator` with `find`:
src/egraph.rs#L1582
warning: called `is_some()` after searching an `Iterator` with `find`
--> src/egraph.rs:1582:45
|
1582 | ... if fixed.iter().find(|x| *x == key).is_some() {
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: consider using: `any(|x| x == key)`
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#search_is_some
|
called `is_some()` after searching an `Iterator` with `find`:
src/egraph.rs#L1568
warning: called `is_some()` after searching an `Iterator` with `find`
--> src/egraph.rs:1568:60
|
1568 | ... if self[id_i].nodes.iter().find(|x| *x == key).is_some() {
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: consider using: `any(|x| x == key)`
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#search_is_some
= note: `#[warn(clippy::search_is_some)]` on by default
|
casting to the same type is unnecessary (`usize` -> `usize`):
src/egraph.rs#L1567
warning: casting to the same type is unnecessary (`usize` -> `usize`)
--> src/egraph.rs:1567:49
|
1567 | for id_i in self.colors[c.0 as usize].as_ref().unwrap().equality_class(self, *id) {
| ^^^^^^^^^^^^ help: try: `c.0`
|
= 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
|
length comparison to zero:
src/egraph.rs#L1517
warning: length comparison to zero
--> src/egraph.rs:1517:24
|
1517 | if n.children().len() > 0
| ^^^^^^^^^^^^^^^^^^^^^^ help: using `!is_empty` is clearer and more explicit: `!n.children().is_empty()`
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#len_zero
|
using `clone` on type `Option<bool>` which implements the `Copy` trait:
src/egraph.rs#L1490
warning: using `clone` on type `Option<bool>` which implements the `Copy` trait
--> src/egraph.rs:1490:55
|
1490 | ... if let Some(is_deleted) = is_deleted.clone() {
| ^^^^^^^^^^^^^^^^^^ help: try dereferencing it: `*is_deleted`
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#clone_on_copy
|
use of `unwrap_or` to construct default value:
src/egraph.rs#L1336
warning: use of `unwrap_or` to construct default value
--> src/egraph.rs:1336:78
|
1336 | for (mut p, id) in self[g].colored_parents.remove(&c_id).unwrap_or(vec![]) {
| ^^^^^^^^^^^^^^^^^ help: try: `unwrap_or_default()`
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#unwrap_or_default
= note: `#[warn(clippy::unwrap_or_default)]` on by default
|
this expression creates a reference which is immediately dereferenced by the compiler:
src/egraph.rs#L1321
warning: this expression creates a reference which is immediately dereferenced by the compiler
--> src/egraph.rs:1321:75
|
1321 | let allids = self.get_color(c_id).unwrap().equality_class(&self, id).collect_vec();
| ^^^^^ help: change this to: `self`
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_borrow
|
this `.into_iter()` call is equivalent to `.iter()` and will not consume the `slice`:
src/egraph.rs#L1265
warning: this `.into_iter()` call is equivalent to `.iter()` and will not consume the `slice`
--> src/egraph.rs:1265:59
|
1265 | let color_parents = self.get_colors_parents(c_id).into_iter().copied().collect_vec();
| ^^^^^^^^^ help: call directly: `iter`
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#into_iter_on_ref
= note: `#[warn(clippy::into_iter_on_ref)]` on by default
|
this expression creates a reference which is immediately dereferenced by the compiler:
src/egraph.rs#L969
warning: this expression creates a reference which is immediately dereferenced by the compiler
--> src/egraph.rs:969:66
|
969 | for id in self.get_color(*c).unwrap().equality_class(&self, *id) {
| ^^^^^ help: change this to: `self`
|
= 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:
src/egraph.rs#L944
warning: this expression creates a reference which is immediately dereferenced by the compiler
--> src/egraph.rs:944:21
|
944 | add(&first);
| ^^^^^^ help: change this to: `first`
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_borrow
|
length comparison to zero:
src/egraph.rs#L941
warning: length comparison to zero
--> src/egraph.rs:941:16
|
941 | if classes[key.0 as usize].as_mut().unwrap().nodes.len() > 0 {
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: using `!is_empty` is clearer and more explicit: `!classes[key.0 as usize].as_mut().unwrap().nodes.is_empty()`
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#len_zero
= note: `#[warn(clippy::len_zero)]` on by default
|
using `clone` on type `Option<ColorId>` which implements the `Copy` trait:
src/egraph.rs#L910
warning: using `clone` on type `Option<ColorId>` which implements the `Copy` trait
--> src/egraph.rs:910:30
|
910 | if let Some(c) = classes[key.0 as usize].as_mut().unwrap().color.clone() {
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: try removing the `clone` call: `classes[key.0 as usize].as_mut().unwrap().color`
|
= 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
|
the following explicit lifetimes could be elided: 'a:
src/egraph.rs#L859
warning: the following explicit lifetimes could be elided: 'a
--> src/egraph.rs:859:17
|
859 | pub fn dump<'a>(&'a self) -> impl Debug + 'a {
| ^^ ^^ ^^
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_lifetimes
= note: `#[warn(clippy::needless_lifetimes)]` on by default
help: elide the lifetimes
|
859 - pub fn dump<'a>(&'a self) -> impl Debug + 'a {
859 + pub fn dump(&self) -> impl Debug + '_ {
|
|
`assert!(false)` should probably be replaced:
src/egraph.rs#L839
warning: `assert!(false)` should probably be replaced
--> src/egraph.rs:839:21
|
839 | / assert!(
840 | | false,
841 | | "Need to clean colors returned by process_colored_unions"
842 | | );
| |_____________________^
|
= help: use `panic!()` or `unreachable!()`
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#assertions_on_constants
= note: `#[warn(clippy::assertions_on_constants)]` on by default
|
this expression creates a reference which is immediately dereferenced by the compiler:
src/egraph.rs#L748
warning: this expression creates a reference which is immediately dereferenced by the compiler
--> src/egraph.rs:748:43
|
748 | let best = Extractor::new(&self, AstSize).find_best(id).1;
| ^^^^^ help: change this to: `self`
|
= 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:
src/egraph.rs#L746
warning: this expression creates a reference which is immediately dereferenced by the compiler
--> src/egraph.rs:746:46
|
746 | let matches = goal.search_eclass(&self, id);
| ^^^^^ help: change this to: `self`
|
= 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:
src/egraph.rs#L689
warning: this expression creates a reference which is immediately dereferenced by the compiler
--> src/egraph.rs:689:33
|
689 | data: N::make(self, &enode),
| ^^^^^^ help: change this to: `enode`
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_borrow
|
`filter(..).map(..)` can be simplified as `filter_map(..)`:
src/egraph.rs#L254
warning: `filter(..).map(..)` can be simplified as `filter_map(..)`
--> src/egraph.rs:254:14
|
254 | .filter(|c| c.is_some())
| ______________^
255 | | .map(|c| c.as_ref().unwrap())
| |_________________________________________^ help: try: `filter_map(|c| c.as_ref())`
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#manual_filter_map
= note: `#[warn(clippy::manual_filter_map)]` on by default
|
very complex type used. Consider factoring parts into `type` definitions:
src/egraph.rs#L220
warning: very complex type used. Consider factoring parts into `type` definitions
--> src/egraph.rs:220:19
|
220 | pub filterer: Option<Rc<dyn Fn(&EGraph<L, N>, Id) -> bool + 'static>>,
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#type_complexity
|
`to_string` applied to a type that implements `Display` in `writeln!` args:
src/dot.rs#L351
warning: `to_string` applied to a type that implements `Display` in `writeln!` args
--> src/dot.rs:351:21
|
351 | class.id.to_string()
| ^^^^^^^^^^^^ help: remove this
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#to_string_in_format_args
= note: `#[warn(clippy::to_string_in_format_args)]` on by default
|
writing `&Vec` instead of `&[_]` involves a new object where a slice will do:
src/dot.rs#L340
warning: writing `&Vec` instead of `&[_]` involves a new object where a slice will do
--> src/dot.rs:340:24
|
340 | dropped_nodes: &Vec<L>,
| ^^^^^^^ help: change this to: `&[L]`
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#ptr_arg
= note: `#[warn(clippy::ptr_arg)]` on by default
|
this expression creates a reference which is immediately dereferenced by the compiler:
src/dot.rs#L191
warning: this expression creates a reference which is immediately dereferenced by the compiler
--> src/dot.rs:191:31
|
191 | .filter(|c| !pred(&self.egraph, c.id))
| ^^^^^^^^^^^^ help: change this to: `self.egraph`
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_borrow
= note: `#[warn(clippy::needless_borrow)]` on by default
|
very complex type used. Consider factoring parts into `type` definitions:
src/dot.rs#L182
warning: very complex type used. Consider factoring parts into `type` definitions
--> src/dot.rs:182:19
|
182 | let pred: Rc<dyn Fn(&EGraph<L, N>, Id) -> bool> = if let Some(b) = self.pred.clone() {
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#type_complexity
|
the borrowed expression implements the required traits:
src/dot.rs#L102
warning: the borrowed expression implements the required traits
--> src/dot.rs:102:22
|
102 | self.run_dot(&["-Tpdf".as_ref(), "-o".as_ref(), filename.as_ref()])
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: change this to: `["-Tpdf".as_ref(), "-o".as_ref(), filename.as_ref()]`
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_borrows_for_generic_args
|
the borrowed expression implements the required traits:
src/dot.rs#L96
warning: the borrowed expression implements the required traits
--> src/dot.rs:96:22
|
96 | self.run_dot(&["-Tsvg".as_ref(), "-o".as_ref(), filename.as_ref()])
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: change this to: `["-Tsvg".as_ref(), "-o".as_ref(), filename.as_ref()]`
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_borrows_for_generic_args
|
the borrowed expression implements the required traits:
src/dot.rs#L90
warning: the borrowed expression implements the required traits
--> src/dot.rs:90:22
|
90 | self.run_dot(&["-Tpng".as_ref(), "-o".as_ref(), filename.as_ref()])
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: change this to: `["-Tpng".as_ref(), "-o".as_ref(), filename.as_ref()]`
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_borrows_for_generic_args
= note: `#[warn(clippy::needless_borrows_for_generic_args)]` on by default
|
very complex type used. Consider factoring parts into `type` definitions:
src/dot.rs#L63
warning: very complex type used. Consider factoring parts into `type` definitions
--> src/dot.rs:63:22
|
63 | pub(crate) pred: Option<Rc<dyn Fn(&EGraph<L, N>, Id) -> bool + 'static>>,
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#type_complexity
= note: `#[warn(clippy::type_complexity)]` on by default
|
casting the result of `i32::abs()` to u32:
src/macros.rs#L94
warning: casting the result of `i32::abs()` to u32
--> src/macros.rs:94:9
|
94 | self.abs() as u32
| ^^^^^^^^^^^^^^^^^ help: replace with: `self.unsigned_abs()`
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#cast_abs_to_unsigned
= note: `#[warn(clippy::cast_abs_to_unsigned)]` on by default
|
function `new_id` is never used:
src/colored_union_find.rs#L38
warning: function `new_id` is never used
--> src/colored_union_find.rs:38:4
|
38 | fn new_id(id: u32) -> AtomicId {
| ^^^^^^
|
method `disp_string` is never used:
src/util.rs#L188
warning: method `disp_string` is never used
--> src/util.rs:188:8
|
187 | pub(crate) trait JoinDisp {
| -------- method in this trait
188 | fn disp_string(self) -> String;
| ^^^^^^^^^^^
|
= note: `#[warn(dead_code)]` on by default
|
unexpected `cfg` condition value: `concurrent_cufind`:
src/colored_union_find.rs#L41
warning: unexpected `cfg` condition value: `concurrent_cufind`
--> src/colored_union_find.rs:41:15
|
41 | #[cfg(not(feature = "concurrent_cufind"))]
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
= note: expected values for `feature` are: `colored`, `colored_no_cmemo`, `colored_no_cremove`, `default`, `keep_splits`, `reports`, `upward-merging`, and `wasm-bindgen`
= help: consider adding `concurrent_cufind` as a feature in `Cargo.toml`
= note: see <https://doc.rust-lang.org/nightly/rustc/check-cfg/cargo-specifics.html> for more information about checking conditional configuration
|
unexpected `cfg` condition value: `concurrent_cufind`:
src/colored_union_find.rs#L39
warning: unexpected `cfg` condition value: `concurrent_cufind`
--> src/colored_union_find.rs:39:11
|
39 | #[cfg(feature = "concurrent_cufind")]
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
= note: expected values for `feature` are: `colored`, `colored_no_cmemo`, `colored_no_cremove`, `default`, `keep_splits`, `reports`, `upward-merging`, and `wasm-bindgen`
= help: consider adding `concurrent_cufind` as a feature in `Cargo.toml`
= note: see <https://doc.rust-lang.org/nightly/rustc/check-cfg/cargo-specifics.html> for more information about checking conditional configuration
|
unexpected `cfg` condition value: `concurrent_cufind`:
src/colored_union_find.rs#L30
warning: unexpected `cfg` condition value: `concurrent_cufind`
--> src/colored_union_find.rs:30:15
|
30 | #[cfg(not(feature = "concurrent_cufind"))]
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
= note: expected values for `feature` are: `colored`, `colored_no_cmemo`, `colored_no_cremove`, `default`, `keep_splits`, `reports`, `upward-merging`, and `wasm-bindgen`
= help: consider adding `concurrent_cufind` as a feature in `Cargo.toml`
= note: see <https://doc.rust-lang.org/nightly/rustc/check-cfg/cargo-specifics.html> for more information about checking conditional configuration
|
unexpected `cfg` condition value: `concurrent_cufind`:
src/colored_union_find.rs#L28
warning: unexpected `cfg` condition value: `concurrent_cufind`
--> src/colored_union_find.rs:28:11
|
28 | #[cfg(feature = "concurrent_cufind")]
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
= note: expected values for `feature` are: `colored`, `colored_no_cmemo`, `colored_no_cremove`, `default`, `keep_splits`, `reports`, `upward-merging`, and `wasm-bindgen`
= help: consider adding `concurrent_cufind` as a feature in `Cargo.toml`
= note: see <https://doc.rust-lang.org/nightly/rustc/check-cfg/cargo-specifics.html> for more information about checking conditional configuration
|
unexpected `cfg` condition value: `concurrent_cufind`:
src/colored_union_find.rs#L22
warning: unexpected `cfg` condition value: `concurrent_cufind`
--> src/colored_union_find.rs:22:15
|
22 | #[cfg(not(feature = "concurrent_cufind"))]
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
= note: expected values for `feature` are: `colored`, `colored_no_cmemo`, `colored_no_cremove`, `default`, `keep_splits`, `reports`, `upward-merging`, and `wasm-bindgen`
= help: consider adding `concurrent_cufind` as a feature in `Cargo.toml`
= note: see <https://doc.rust-lang.org/nightly/rustc/check-cfg/cargo-specifics.html> for more information about checking conditional configuration
|
unexpected `cfg` condition value: `concurrent_cufind`:
src/colored_union_find.rs#L20
warning: unexpected `cfg` condition value: `concurrent_cufind`
--> src/colored_union_find.rs:20:11
|
20 | #[cfg(feature = "concurrent_cufind")]
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
= note: expected values for `feature` are: `colored`, `colored_no_cmemo`, `colored_no_cremove`, `default`, `keep_splits`, `reports`, `upward-merging`, and `wasm-bindgen`
= help: consider adding `concurrent_cufind` as a feature in `Cargo.toml`
= note: see <https://doc.rust-lang.org/nightly/rustc/check-cfg/cargo-specifics.html> for more information about checking conditional configuration
|
unexpected `cfg` condition value: `concurrent_cufind`:
src/colored_union_find.rs#L15
warning: unexpected `cfg` condition value: `concurrent_cufind`
--> src/colored_union_find.rs:15:11
|
15 | #[cfg(not(feature = "concurrent_cufind"))]
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
= note: expected values for `feature` are: `colored`, `colored_no_cmemo`, `colored_no_cremove`, `default`, `keep_splits`, `reports`, `upward-merging`, and `wasm-bindgen`
= help: consider adding `concurrent_cufind` as a feature in `Cargo.toml`
= note: see <https://doc.rust-lang.org/nightly/rustc/check-cfg/cargo-specifics.html> for more information about checking conditional configuration
|
unexpected `cfg` condition value: `concurrent_cufind`:
src/colored_union_find.rs#L13
warning: unexpected `cfg` condition value: `concurrent_cufind`
--> src/colored_union_find.rs:13:7
|
13 | #[cfg(feature = "concurrent_cufind")]
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
= note: expected values for `feature` are: `colored`, `colored_no_cmemo`, `colored_no_cremove`, `default`, `keep_splits`, `reports`, `upward-merging`, and `wasm-bindgen`
= help: consider adding `concurrent_cufind` as a feature in `Cargo.toml`
= note: see <https://doc.rust-lang.org/nightly/rustc/check-cfg/cargo-specifics.html> for more information about checking conditional configuration
|
redundant field names in struct initialization:
src/ser.rs#L165
warning: redundant field names in struct initialization
--> src/ser.rs:165:17
|
165 | id: id,
| ^^^^^^ help: replace it with: `id`
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#redundant_field_names
|
unneeded unit return type:
src/machine.rs#L62
warning: unneeded unit return type
--> src/machine.rs:62:26
|
62 | mut f: impl FnMut(&L) -> (),
| ^^^^^^ help: remove the `-> ()`
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#unused_unit
= note: `#[warn(clippy::unused_unit)]` on by default
|
unexpected `cfg` condition value: `serde-1`:
src/language.rs#L309
warning: unexpected `cfg` condition value: `serde-1`
--> src/language.rs:309:7
|
309 | #[cfg(feature = "serde-1")]
| ^^^^^^^^^^^^^^^^^^^
|
= note: expected values for `feature` are: `colored`, `colored_no_cmemo`, `colored_no_cremove`, `default`, `keep_splits`, `reports`, `upward-merging`, and `wasm-bindgen`
= help: consider adding `serde-1` as a feature in `Cargo.toml`
= note: see <https://doc.rust-lang.org/nightly/rustc/check-cfg/cargo-specifics.html> for more information about checking conditional configuration
|
redundant field names in struct initialization:
src/egraph.rs#L1957
warning: redundant field names in struct initialization
--> src/egraph.rs:1957:17
|
1957 | id: id,
| ^^^^^^ help: replace it with: `id`
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#redundant_field_names
= note: `#[warn(clippy::redundant_field_names)]` on by default
|
unexpected `cfg` condition value: `stats`:
src/egraph.rs#L965
warning: unexpected `cfg` condition value: `stats`
--> src/egraph.rs:965:15
|
965 | #[cfg(feature = "stats")] {
| ^^^^^^^^^^^^^^^^^
|
= note: expected values for `feature` are: `colored`, `colored_no_cmemo`, `colored_no_cremove`, `default`, `keep_splits`, `reports`, `upward-merging`, and `wasm-bindgen`
= help: consider adding `stats` as a feature in `Cargo.toml`
= note: see <https://doc.rust-lang.org/nightly/rustc/check-cfg/cargo-specifics.html> for more information about checking conditional configuration
= note: `#[warn(unexpected_cfgs)]` on by default
|
this `if` statement can be collapsed:
src/egraph.rs#L836
warning: this `if` statement can be collapsed
--> src/egraph.rs:836:13
|
836 | / if cfg!(feature = "colored") {
837 | | if !self.colors.is_empty() {
838 | | self.process_colored_unions();
839 | | assert!(
... |
843 | | }
844 | | }
| |_____________^
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#collapsible_if
= note: `#[warn(clippy::collapsible_if)]` on by default
help: collapse nested if block
|
836 ~ if cfg!(feature = "colored") && !self.colors.is_empty() {
837 + self.process_colored_unions();
838 + assert!(
839 + false,
840 + "Need to clean colors returned by process_colored_unions"
841 + );
842 + }
|
|
build
The following actions uses node12 which is deprecated and will be forced to run on node16: actions/checkout@v2, 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/
|
build
The following actions use a deprecated Node.js version and will be forced to run on node20: actions/checkout@v2, actions-rs/toolchain@v1, actions-rs/clippy-check@v1. For more info: https://github.blog/changelog/2024-03-07-github-actions-all-actions-will-run-on-node20-instead-of-node16-by-default/
|
build
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/
|
build
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/
|
build
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/
|
build
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/
|