Skip to content

Added some support for case split conclusions in rebuild #35

Added some support for case split conclusions in rebuild

Added some support for case split conclusions in rebuild #35

GitHub Actions / clippy failed Sep 15, 2024 in 1s

clippy

1 error, 142 warnings

Details

Results

Message level Amount
Internal compiler error 0
Error 1
Warning 142
Note 0
Help 0

Versions

  • rustc 1.81.0 (eeb90cda1 2024-09-04)
  • cargo 1.81.0 (2dbb1af80 2024-08-20)
  • clippy 0.1.81 (eeb90cd 2024-09-04)

Annotations

Check warning on line 69 in src/multipattern.rs

See this annotation in the file changed.

@github-actions github-actions / clippy

useless use of `vec!`

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

Check warning on line 189 in src/multipattern.rs

See this annotation in the file changed.

@github-actions github-actions / clippy

unnecessary closure used with `bool::then`

warning: unnecessary closure used with `bool::then`
   --> src/multipattern.rs:189:9
    |
189 |         (!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

Check warning on line 107 in src/multipattern.rs

See this annotation in the file changed.

@github-actions github-actions / clippy

all variants have the same postfix: `Error`

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

Check warning on line 85 in src/multipattern.rs

See this annotation in the file changed.

@github-actions github-actions / clippy

length comparison to zero

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

Check warning on line 81 in src/multipattern.rs

See this annotation in the file changed.

@github-actions github-actions / clippy

length comparison to zero

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

Check warning on line 187 in src/colored_union_find.rs

See this annotation in the file changed.

@github-actions github-actions / clippy

deref which would be done by auto-deref

warning: deref which would be done by auto-deref
   --> src/colored_union_find.rs:187:37
    |
187 |                 .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

Check warning on line 167 in src/colored_union_find.rs

See this annotation in the file changed.

@github-actions github-actions / clippy

unneeded `return` statement

warning: unneeded `return` statement
   --> src/colored_union_find.rs:167:9
    |
167 |         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`
    |
167 -         return Some((*x_res, *y_res));
167 +         Some((*x_res, *y_res))
    |

Check warning on line 147 in src/colored_union_find.rs

See this annotation in the file changed.

@github-actions github-actions / clippy

called `map(..).flatten()` on `Option`

warning: called `map(..).flatten()` on `Option`
   --> src/colored_union_find.rs:147:14
    |
147 |             .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

Check warning on line 97 in src/colored_union_find.rs

See this annotation in the file changed.

@github-actions github-actions / clippy

redundant closure

warning: redundant closure
  --> src/colored_union_find.rs:97:46
   |
97 |             parents: parents.into_iter().map(|x| AtomicU32::new(x)).collect(),
   |                                              ^^^^^^^^^^^^^^^^^^^^^ help: replace the closure with the function itself: `AtomicU32::new`
   |
   = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#redundant_closure

Check warning on line 45 in src/tools.rs

See this annotation in the file changed.

@github-actions github-actions / clippy

unneeded `return` statement

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
   |

Check warning on line 110 in src/tools.rs

See this annotation in the file changed.

@github-actions github-actions / clippy

module has the same name as its containing module

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

Check warning on line 170 in src/eggstentions/tree.rs

See this annotation in the file changed.

@github-actions github-actions / clippy

question mark operator is useless here

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

Check warning on line 110 in src/eggstentions/tree.rs

See this annotation in the file changed.

@github-actions github-actions / clippy

unnecessary closure used with `bool::then`

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

Check warning on line 116 in src/eggstentions/expression_ops.rs

See this annotation in the file changed.

@github-actions github-actions / clippy

methods called `into_*` usually take `self` by value

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

Check warning on line 107 in src/eggstentions/expression_ops.rs

See this annotation in the file changed.

@github-actions github-actions / clippy

an implementation of `From` is preferred since it gives you `Into<_>` for free where the reverse isn't true

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())
    |

Check warning on line 91 in src/eggstentions/expression_ops.rs

See this annotation in the file changed.

@github-actions github-actions / clippy

you seem to be trying to pop elements from a `Vec` in a loop

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 ~             
   |

Check warning on line 49 in src/eggstentions/expression_ops.rs

See this annotation in the file changed.

@github-actions github-actions / clippy

the following explicit lifetimes could be elided: 'a

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 {
   |

Check warning on line 42 in src/eggstentions/expression_ops.rs

See this annotation in the file changed.

@github-actions github-actions / clippy

`to_string` applied to a type that implements `Display` in `format!` args

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

Check warning on line 40 in src/eggstentions/expression_ops.rs

See this annotation in the file changed.

@github-actions github-actions / clippy

`to_string` applied to a type that implements `Display` in `format!` args

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

Check warning on line 40 in src/eggstentions/expression_ops.rs

See this annotation in the file changed.

@github-actions github-actions / clippy

useless use of `format!`

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

Check warning on line 50 in src/eggstentions/costs.rs

See this annotation in the file changed.

@github-actions github-actions / clippy

non-canonical implementation of `partial_cmp` on an `Ord` type

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

Check warning on line 20 in src/eggstentions/costs.rs

See this annotation in the file changed.

@github-actions github-actions / clippy

writing `&Vec` instead of `&[_]` involves a new object where a slice will do

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

Check warning on line 110 in src/eggstentions/reconstruct.rs

See this annotation in the file changed.

@github-actions github-actions / clippy

called `unwrap` on `color` after checking its variant with `is_some`

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

Check warning on line 85 in src/eggstentions/reconstruct.rs

See this annotation in the file changed.

@github-actions github-actions / clippy

called `map(..).flatten()` on `Option`

warning: called `map(..).flatten()` on `Option`
  --> src/eggstentions/reconstruct.rs:80:19
   |
80 |               color.map(|c_id|
   |  ___________________^
81 | |                 graph.get_color(c_id).map(|x|
82 | |                     x.equality_class(graph, *c).find_map(|id|
83 | |                         // Build translation is only called when a translation exists
84 | |                          translations.get(&id))))
85 | |                 .flatten().flatten()
   | |__________________________^
   |
   = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#map_flatten
help: try replacing `map` with `and_then` and remove the `.flatten()`
   |
80 ~             color.and_then(|c_id|
81 +                 graph.get_color(c_id).map(|x|
82 +                     x.equality_class(graph, *c).find_map(|id|
83 +                         // Build translation is only called when a translation exists
84 ~                          translations.get(&id)))).flatten()
   |

Check warning on line 70 in src/eggstentions/reconstruct.rs

See this annotation in the file changed.

@github-actions github-actions / clippy

this expression creates a reference which is immediately dereferenced by the compiler

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