Skip to content

Avoid redundant push to the queue in incremental simulation; surprisi… #181

Avoid redundant push to the queue in incremental simulation; surprisi…

Avoid redundant push to the queue in incremental simulation; surprisi… #181

Triggered via push January 25, 2024 17:14
Status Success
Total duration 3m 54s
Artifacts

build.yml

on: push
Matrix: Test
Fit to window
Zoom out
Zoom in

Annotations

118 warnings
writing `&Vec` instead of `&[_]` involves a new object where a slice will do: src/sim.rs#L104
warning: writing `&Vec` instead of `&[_]` involves a new object where a slice will do --> src/sim.rs:104:54 | 104 | pub(crate) fn detects_faults(aig: &Network, pattern: &Vec<bool>, faults: &Vec<Fault>) -> Vec<bool> { | ^^^^^^^^^^ help: change this to: `&[bool]` | = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#ptr_arg
writing `&Vec` instead of `&[_]` involves a new object where a slice will do: src/sim.rs#L59
warning: writing `&Vec` instead of `&[_]` involves a new object where a slice will do --> src/sim.rs:59:19 | 59 | input_values: &Vec<bool>, | ^^^^^^^^^^ | = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#ptr_arg help: change this to | 59 ~ input_values: &[bool], 60 | faults: &Vec<Fault>, 61 | ) -> Vec<bool> { 62 | assert!(a.is_comb()); 63 ~ let input = vec![input_values.to_owned()]; |
writing `&Vec` instead of `&[_]` involves a new object where a slice will do: src/sim.rs#L38
warning: writing `&Vec` instead of `&[_]` involves a new object where a slice will do --> src/sim.rs:38:49 | 38 | pub fn simulate_comb(a: &Network, input_values: &Vec<bool>) -> Vec<bool> { | ^^^^^^^^^^ | = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#ptr_arg help: change this to | 38 ~ pub fn simulate_comb(a: &Network, input_values: &[bool]) -> Vec<bool> { 39 | assert!(a.is_comb()); 40 ~ let input = vec![input_values.to_owned()]; |
the loop variable `i` is used to index `next_values`: src/sim/simple_sim.rs#L115
warning: the loop variable `i` is used to index `next_values` --> src/sim/simple_sim.rs:115:18 | 115 | for i in 0..self.aig.nb_nodes() { | ^^^^^^^^^^^^^^^^^^^^^^ | = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_range_loop help: consider using an iterator and enumerate() | 115 | for (i, <item>) in next_values.iter_mut().enumerate().take(self.aig.nb_nodes()) { | ~~~~~~~~~~~ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
writing `&Vec` instead of `&[_]` involves a new object where a slice will do: src/sim/simple_sim.rs#L63
warning: writing `&Vec` instead of `&[_]` involves a new object where a slice will do --> src/sim/simple_sim.rs:63:23 | 63 | input_values: &Vec<Vec<u64>>, | ^^^^^^^^^^^^^^ help: change this to: `&[Vec<u64>]` | = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#ptr_arg
writing `&Vec` instead of `&[_]` involves a new object where a slice will do: src/sim/simple_sim.rs#L45
warning: writing `&Vec` instead of `&[_]` involves a new object where a slice will do --> src/sim/simple_sim.rs:45:41 | 45 | pub fn run(&mut self, input_values: &Vec<Vec<u64>>) -> Vec<Vec<u64>> { | ^^^^^^^^^^^^^^ help: change this to: `&[Vec<u64>]` | = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#ptr_arg
writing `&Vec` instead of `&[_]` involves a new object where a slice will do: src/sim/incremental_sim.rs#L56
warning: writing `&Vec` instead of `&[_]` involves a new object where a slice will do --> src/sim/incremental_sim.rs:56:49 | 56 | pub fn run_initial(&mut self, input_values: &Vec<u64>) { | ^^^^^^^^^ help: change this to: `&[u64]` | = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#ptr_arg
this boolean expression can be simplified: src/sim/fault.rs#L48
warning: this boolean expression can be simplified --> src/sim/fault.rs:48:24 | 48 | ret.retain(|f| !redundant.binary_search(f).is_ok()); | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: try: `redundant.binary_search(f).is_err()` | = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#nonminimal_bool = note: `#[warn(clippy::nonminimal_bool)]` on by default
this expression creates a reference which is immediately dereferenced by the compiler: src/optim/share_logic.rs#L344
warning: this expression creates a reference which is immediately dereferenced by the compiler --> src/optim/share_logic.rs:344:24 | 344 | *aig = factor_nary(&aig); | ^^^^ help: change this to: `aig` | = 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/optim/share_logic.rs#L343
warning: this expression creates a reference which is immediately dereferenced by the compiler --> src/optim/share_logic.rs:343:25 | 343 | *aig = flatten_nary(&aig, flattening_limit); | ^^^^ help: change this to: `aig` | = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_borrow
redundant closure: src/optim/share_logic.rs#L335
warning: redundant closure --> src/optim/share_logic.rs:335:52 | 335 | let aig2 = factor_gates(&aig1, |g| g.is_xor(), |a, b| Gate::xor(a, b)); | ^^^^^^^^^^^^^^^^^^^^^^ help: replace the closure with the function itself: `Gate::xor` | = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#redundant_closure
redundant closure: src/optim/share_logic.rs#L334
warning: redundant closure --> src/optim/share_logic.rs:334:50 | 334 | let aig1 = factor_gates(aig, |g| g.is_and(), |a, b| Gate::and(a, b)); | ^^^^^^^^^^^^^^^^^^^^^^ help: replace the closure with the function itself: `Gate::and` | = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#redundant_closure
returning the result of a `let` binding from a block: src/optim/share_logic.rs#L336
warning: returning the result of a `let` binding from a block --> src/optim/share_logic.rs:336:5 | 335 | let aig2 = factor_gates(&aig1, |g| g.is_xor(), |a, b| Gate::xor(a, b)); | ----------------------------------------------------------------------- unnecessary `let` binding 336 | aig2 | ^^^^ | = 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 | 335 ~ 336 ~ factor_gates(&aig1, |g| g.is_xor(), |a, b| Gate::xor(a, b)) |
the loop variable `i` is used to index `visited`: src/network/network.rs#L321
warning: the loop variable `i` is used to index `visited` --> src/network/network.rs:321:18 | 321 | for i in 0..self.nb_nodes() { | ^^^^^^^^^^^^^^^^^^ | = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_range_loop help: consider using an iterator and enumerate() | 321 | for (i, <item>) in visited.iter_mut().enumerate().take(self.nb_nodes()) { | ~~~~~~~~~~~ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
the loop variable `i` is only used to index `new_nodes`: src/network/network.rs#L289
warning: the loop variable `i` is only used to index `new_nodes` --> src/network/network.rs:289:18 | 289 | for i in 0..new_nodes.len() { | ^^^^^^^^^^^^^^^^^^ | = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_range_loop help: consider using an iterator | 289 | for <item> in &mut new_nodes { | ~~~~~~ ~~~~~~~~~~~~~~
the loop variable `i` is used to index `translation`: src/network/network.rs#L273
warning: the loop variable `i` is used to index `translation` --> src/network/network.rs:273:18 | 273 | for i in 0..self.nb_nodes() { | ^^^^^^^^^^^^^^^^^^ | = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_range_loop help: consider using an iterator and enumerate() | 273 | for (i, <item>) in translation.iter_mut().enumerate().take(self.nb_nodes()) { | ~~~~~~~~~~~ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
module has the same name as its containing module: src/network.rs#L7
warning: module has the same name as its containing module --> src/network.rs:7:1 | 7 | mod network; | ^^^^^^^^^^^^ | = 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
redundant closure: src/network/gates.rs#L280
warning: redundant closure --> src/network/gates.rs:280:47 | 280 | inputs: lut.inputs.iter().map(|s| t(s)).collect(), | ^^^^^^^^ help: replace the closure with the function itself: `t` | = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#redundant_closure
redundant closure: src/network/gates.rs#L277
warning: redundant closure --> src/network/gates.rs:277:46 | 277 | Nary(v, tp) => Nary(v.iter().map(|s| t(s)).collect(), *tp), | ^^^^^^^^ help: replace the closure with the function itself: `t` | = 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
unneeded `return` statement: src/network/gates.rs#L267
warning: unneeded `return` statement --> src/network/gates.rs:267:9 | 267 | return matches!(self, Gate::Buf(_)); | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ | = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_return help: remove `return` | 267 - return matches!(self, Gate::Buf(_)); 267 + matches!(self, Gate::Buf(_)) |
unneeded `return` statement: src/network/gates.rs#L256
warning: unneeded `return` statement --> src/network/gates.rs:256:9 | 256 | / return matches!( 257 | | self, 258 | | Gate::Binary(_, BinaryType::Xor) 259 | | | Gate::Ternary(_, TernaryType::Xor) 260 | | | Gate::Nary(_, NaryType::Xor) 261 | | | Gate::Nary(_, NaryType::Xnor) 262 | | ); | |_________^ | = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_return help: remove `return` | 256 ~ matches!( 257 + self, 258 + Gate::Binary(_, BinaryType::Xor) 259 + | Gate::Ternary(_, TernaryType::Xor) 260 + | Gate::Nary(_, NaryType::Xor) 261 + | Gate::Nary(_, NaryType::Xnor) 262 ~ ) |
unneeded `return` statement: src/network/gates.rs#L243
warning: unneeded `return` statement --> src/network/gates.rs:243:9 | 243 | / return matches!( 244 | | self, 245 | | Gate::Binary(_, BinaryType::And) 246 | | | Gate::Ternary(_, TernaryType::And) ... | 250 | | | Gate::Nary(_, NaryType::Nor) 251 | | ); | |_________^ | = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_return help: remove `return` | 243 ~ matches!( 244 + self, 245 + Gate::Binary(_, BinaryType::And) 246 + | Gate::Ternary(_, TernaryType::And) 247 + | Gate::Nary(_, NaryType::And) 248 + | Gate::Nary(_, NaryType::Nand) 249 + | Gate::Nary(_, NaryType::Or) 250 + | Gate::Nary(_, NaryType::Nor) 251 ~ ) |
unneeded `return` statement: src/network/gates.rs#L233
warning: unneeded `return` statement --> src/network/gates.rs:233:9 | 233 | / return matches!( 234 | | self, 235 | | Gate::Binary(_, BinaryType::Xor) 236 | | | Gate::Ternary(_, TernaryType::Xor) 237 | | | Gate::Nary(_, NaryType::Xor) 238 | | ); | |_________^ | = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_return help: remove `return` | 233 ~ matches!( 234 + self, 235 + Gate::Binary(_, BinaryType::Xor) 236 + | Gate::Ternary(_, TernaryType::Xor) 237 + | Gate::Nary(_, NaryType::Xor) 238 ~ ) |
unneeded `return` statement: src/network/gates.rs#L223
warning: unneeded `return` statement --> src/network/gates.rs:223:9 | 223 | / return matches!( 224 | | self, 225 | | Gate::Binary(_, BinaryType::And) 226 | | | Gate::Ternary(_, TernaryType::And) 227 | | | Gate::Nary(_, NaryType::And) 228 | | ); | |_________^ | = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_return help: remove `return` | 223 ~ matches!( 224 + self, 225 + Gate::Binary(_, BinaryType::And) 226 + | Gate::Ternary(_, TernaryType::And) 227 + | Gate::Nary(_, NaryType::And) 228 ~ ) |
unneeded `return` statement: src/network/gates.rs#L218
warning: unneeded `return` statement --> src/network/gates.rs:218:9 | 218 | return !matches!(self, Gate::Dff(_)); | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ | = 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` | 218 - return !matches!(self, Gate::Dff(_)); 218 + !matches!(self, Gate::Dff(_)) |
writing `&Vec` instead of `&[_]` involves a new object where a slice will do: src/io/patterns.rs#L97
warning: writing `&Vec` instead of `&[_]` involves a new object where a slice will do --> src/io/patterns.rs:97:54 | 97 | pub fn write_patterns<W: Write>(w: &mut W, patterns: &Vec<Vec<Vec<bool>>>) { | ^^^^^^^^^^^^^^^^^^^^ help: change this to: `&[Vec<Vec<bool>>]` | = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#ptr_arg
unnecessary `if let` since only the `Ok` variant of the iterator element is used: src/io/patterns.rs#L28
warning: unnecessary `if let` since only the `Ok` variant of the iterator element is used --> src/io/patterns.rs:28:5 | 28 | for l in BufReader::new(r).lines() { | ^ ------------------------- help: try: `BufReader::new(r).lines().flatten()` | _____| | | 29 | | if let Ok(s) = l { 30 | | line_ind += 1; 31 | | let t = s.trim(); ... | 76 | | } 77 | | } | |_____^ | help: ...and remove the `if let` statement in the for loop --> src/io/patterns.rs:29:9 | 29 | / if let Ok(s) = l { 30 | | line_ind += 1; 31 | | let t = s.trim(); 32 | | if t.is_empty() || t.starts_with('*') { ... | 75 | | } 76 | | } | |_________^ = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#manual_flatten
single-character string constant used as pattern: src/io/blif.rs#L258
warning: single-character string constant used as pattern --> src/io/blif.rs:258:73 | 258 | let is_continuation = comment_pos.is_none() && ss.ends_with("\\"); | ^^^^ help: try using a `char` instead: `'\\'` | = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#single_char_pattern
unnecessary `if let` since only the `Ok` variant of the iterator element is used: src/io/blif.rs#L249
warning: unnecessary `if let` since only the `Ok` variant of the iterator element is used --> src/io/blif.rs:249:5 | 249 | for l in BufReader::new(r).lines() { | ^ ------------------------- help: try: `BufReader::new(r).lines().flatten()` | _____| | | 250 | | if let Ok(s) = l { 251 | | // TODO: parse comments properly, not just at the beginning of the line 252 | | let comment_pos = s.find('#'); ... | 273 | | } 274 | | } | |_____^ | help: ...and remove the `if let` statement in the for loop --> src/io/blif.rs:250:9 | 250 | / if let Ok(s) = l { 251 | | // TODO: parse comments properly, not just at the beginning of the line 252 | | let comment_pos = s.find('#'); 253 | | ... | 272 | | ss.clear(); 273 | | } | |_________^ = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#manual_flatten = note: `#[warn(clippy::manual_flatten)]` on by default
single-character string constant used as pattern: src/io/blif.rs#L234
warning: single-character string constant used as pattern --> src/io/blif.rs:234:38 | 234 | if tokens[0].starts_with(".") { | ^^^ help: try using a `char` instead: `'.'` | = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#single_char_pattern
length comparison to zero: src/io/blif.rs#L180
warning: length comparison to zero --> src/io/blif.rs:180:20 | 180 | if deps.len() == 0 { | ^^^^^^^^^^^^^^^ help: using `is_empty` is clearer and more explicit: `deps.is_empty()` | = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#len_zero
length comparison to zero: src/io/blif.rs#L172
warning: length comparison to zero --> src/io/blif.rs:172:20 | 172 | if deps.len() == 0 { | ^^^^^^^^^^^^^^^ help: using `is_empty` is clearer and more explicit: `deps.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
casting a character literal to `u8` truncates: src/io/blif.rs#L161
warning: casting a character literal to `u8` truncates --> src/io/blif.rs:161:33 | 161 | } else if *c != '-' as u8 { | ^^^^^^^^^ help: use a byte literal instead: `b'-'` | = note: `char` is four bytes wide, but `u8` is a single byte = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#char_lit_as_u8
casting a character literal to `u8` truncates: src/io/blif.rs#L159
warning: casting a character literal to `u8` truncates --> src/io/blif.rs:159:33 | 159 | } else if *c == '1' as u8 { | ^^^^^^^^^ help: use a byte literal instead: `b'1'` | = note: `char` is four bytes wide, but `u8` is a single byte = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#char_lit_as_u8
casting a character literal to `u8` truncates: src/io/blif.rs#L157
warning: casting a character literal to `u8` truncates --> src/io/blif.rs:157:26 | 157 | if *c == '0' as u8 { | ^^^^^^^^^ help: use a byte literal instead: `b'0'` | = note: `char` is four bytes wide, but `u8` is a single byte = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#char_lit_as_u8 = note: `#[warn(clippy::char_lit_as_u8)]` on by default
the loop variable `j` is only used to index `statements`: src/io/blif.rs#L128
warning: the loop variable `j` is only used to index `statements` --> src/io/blif.rs:128:18 | 128 | for j in (i + 1)..statements.len() { | ^^^^^^^^^^^^^^^^^^^^^^^^^ | = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_range_loop help: consider using an iterator | 128 | for <item> in statements.iter().skip((i + 1)) { | ~~~~~~ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
you seem to use `.enumerate()` and immediately discard the index: src/io/blif.rs#L45
warning: you seem to use `.enumerate()` and immediately discard the index --> src/io/blif.rs:45:34 | 45 | for (_, name) in inputs.iter().enumerate() { | ^^^^^^^^^^^^^^^^^^^^^^^^^ | = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#unused_enumerate_index = note: `#[warn(clippy::unused_enumerate_index)]` on by default help: remove the `.enumerate()` call | 45 | for name in inputs.iter() { | ~~~~ ~~~~~~~~~~~~~
single-character string constant used as pattern: src/io/bench.rs#L181
warning: single-character string constant used as pattern --> src/io/bench.rs:181:28 | 181 | if !t.contains("=") { | ^^^ help: try using a `char` instead: `'='` | = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#single_char_pattern = note: `#[warn(clippy::single_char_pattern)]` on by default
writing `&Vec` instead of `&[_]` involves a new object where a slice will do: src/io/bench.rs#L58
warning: writing `&Vec` instead of `&[_]` involves a new object where a slice will do --> src/io/bench.rs:58:16 | 58 | statement: &Vec<String>, | ^^^^^^^^^^^^ help: change this to: `&[String]` | = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#ptr_arg
writing `&Vec` instead of `&[_]` involves a new object where a slice will do: src/io/bench.rs#L41
warning: writing `&Vec` instead of `&[_]` involves a new object where a slice will do --> src/io/bench.rs:41:31 | 41 | fn check_statement(statement: &Vec<String>, name_to_sig: &HashMap<String, Signal>) { | ^^^^^^^^^^^^ help: change this to: `&[String]` | = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#ptr_arg
`to_string` applied to a type that implements `Display` in `assert!` args: src/io/bench.rs#L28
warning: `to_string` applied to a type that implements `Display` in `assert!` args --> src/io/bench.rs:28:54 | 28 | assert!(!present, "{} is defined twice", s[0].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/io/bench.rs#L15
warning: writing `&Vec` instead of `&[_]` involves a new object where a slice will do --> src/io/bench.rs:15:13 | 15 | inputs: &Vec<String>, | ^^^^^^^^^^^^ help: change this to: `&[String]` | = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#ptr_arg
writing `&Vec` instead of `&[_]` involves a new object where a slice will do: src/io/bench.rs#L14
warning: writing `&Vec` instead of `&[_]` involves a new object where a slice will do --> src/io/bench.rs:14:17 | 14 | statements: &Vec<Vec<String>>, | ^^^^^^^^^^^^^^^^^ help: change this to: `&[Vec<String>]` | = 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
match expression looks like `matches!` macro: src/equiv.rs#L317
warning: match expression looks like `matches!` macro --> src/equiv.rs:317:25 | 317 | let b = match sol.lit_value(t[&Signal::from_input(inp as u32)]) { | _________________________^ 318 | | TernaryVal::True => true, 319 | | _ => false, 320 | | }; | |_________________^ help: try: `matches!(sol.lit_value(t[&Signal::from_input(inp as u32)]), TernaryVal::True)` | = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#match_like_matches_macro = note: `#[warn(clippy::match_like_matches_macro)]` on by default
the variable `i` is used as a loop counter: src/equiv.rs#L292
warning: the variable `i` is used as a loop counter --> src/equiv.rs:292:5 | 292 | for s in all_lits { | ^^^^^^^^^^^^^^^^^ help: consider using: `for (i, s) in (0_u32..).zip(all_lits.into_iter())` | = note: `i` is of type `u32`, making it ineligible for `Iterator::enumerate` = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#explicit_counter_loop = note: `#[warn(clippy::explicit_counter_loop)]` on by default
the loop variable `i` is used to index `v`: src/equiv.rs#L72
warning: the loop variable `i` is used to index `v` --> src/equiv.rs:72:18 | 72 | for i in 0..lut.num_vars() { | ^^^^^^^^^^^^^^^^^ | = 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() | 72 | for (i, <item>) in v.iter().enumerate().take(lut.num_vars()) { | ~~~~~~~~~~~ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
useless use of `format!`: src/atpg.rs#L250
warning: useless use of `format!` --> src/atpg.rs:250:30 | 250 | progress.set_postfix(format!("patterns=-")); | ^^^^^^^^^^^^^^^^^^^^^ help: consider using `.to_string()`: `"patterns=-".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
this expression creates a reference which is immediately dereferenced by the compiler: src/atpg.rs#L80
warning: this expression creates a reference which is immediately dereferenced by the compiler --> src/atpg.rs:80:40 | 80 | assert_eq!(detects_faults(aig, &pattern, &vec![fault]), vec![true]); | ^^^^^^^^ help: change this to: `pattern` | = 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
this `else { if .. }` block can be collapsed: src/io/blif.rs#L179
warning: this `else { if .. }` block can be collapsed --> src/io/blif.rs:179:20 | 179 | } else { | ____________________^ 180 | | if deps.len() == 0 { 181 | | Gate::Buf(Signal::zero()) 182 | | } else if deps.len() == 1 { ... | 186 | | } 187 | | }; | |_____________^ | = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#collapsible_else_if = note: `#[warn(clippy::collapsible_else_if)]` on by default help: collapse nested if block | 179 ~ } else if deps.len() == 0 { 180 + Gate::Buf(Signal::zero()) 181 + } else if deps.len() == 1 { 182 + Gate::Buf(!deps[0]) 183 + } else { 184 + Gate::Nary(deps.into(), NaryType::Nand) 185 ~ }; |
redundant field names in struct initialization: src/atpg.rs#L147
warning: redundant field names in struct initialization --> src/atpg.rs:147:13 | 147 | faults: faults, | ^^^^^^^^^^^^^^ help: replace it with: `faults` | = 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
writing `&Vec` instead of `&[_]` involves a new object where a slice will do: src/sim.rs#L104
warning: writing `&Vec` instead of `&[_]` involves a new object where a slice will do --> src/sim.rs:104:54 | 104 | pub(crate) fn detects_faults(aig: &Network, pattern: &Vec<bool>, faults: &Vec<Fault>) -> Vec<bool> { | ^^^^^^^^^^ help: change this to: `&[bool]` | = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#ptr_arg
writing `&Vec` instead of `&[_]` involves a new object where a slice will do: src/sim.rs#L59
warning: writing `&Vec` instead of `&[_]` involves a new object where a slice will do --> src/sim.rs:59:19 | 59 | input_values: &Vec<bool>, | ^^^^^^^^^^ | = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#ptr_arg help: change this to | 59 ~ input_values: &[bool], 60 | faults: &Vec<Fault>, 61 | ) -> Vec<bool> { 62 | assert!(a.is_comb()); 63 ~ let input = vec![input_values.to_owned()]; |
writing `&Vec` instead of `&[_]` involves a new object where a slice will do: src/sim.rs#L38
warning: writing `&Vec` instead of `&[_]` involves a new object where a slice will do --> src/sim.rs:38:49 | 38 | pub fn simulate_comb(a: &Network, input_values: &Vec<bool>) -> Vec<bool> { | ^^^^^^^^^^ | = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#ptr_arg help: change this to | 38 ~ pub fn simulate_comb(a: &Network, input_values: &[bool]) -> Vec<bool> { 39 | assert!(a.is_comb()); 40 ~ let input = vec![input_values.to_owned()]; |
the loop variable `i` is used to index `next_values`: src/sim/simple_sim.rs#L115
warning: the loop variable `i` is used to index `next_values` --> src/sim/simple_sim.rs:115:18 | 115 | for i in 0..self.aig.nb_nodes() { | ^^^^^^^^^^^^^^^^^^^^^^ | = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_range_loop help: consider using an iterator and enumerate() | 115 | for (i, <item>) in next_values.iter_mut().enumerate().take(self.aig.nb_nodes()) { | ~~~~~~~~~~~ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
writing `&Vec` instead of `&[_]` involves a new object where a slice will do: src/sim/simple_sim.rs#L63
warning: writing `&Vec` instead of `&[_]` involves a new object where a slice will do --> src/sim/simple_sim.rs:63:23 | 63 | input_values: &Vec<Vec<u64>>, | ^^^^^^^^^^^^^^ help: change this to: `&[Vec<u64>]` | = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#ptr_arg
writing `&Vec` instead of `&[_]` involves a new object where a slice will do: src/sim/simple_sim.rs#L45
warning: writing `&Vec` instead of `&[_]` involves a new object where a slice will do --> src/sim/simple_sim.rs:45:41 | 45 | pub fn run(&mut self, input_values: &Vec<Vec<u64>>) -> Vec<Vec<u64>> { | ^^^^^^^^^^^^^^ help: change this to: `&[Vec<u64>]` | = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#ptr_arg
writing `&Vec` instead of `&[_]` involves a new object where a slice will do: src/sim/incremental_sim.rs#L56
warning: writing `&Vec` instead of `&[_]` involves a new object where a slice will do --> src/sim/incremental_sim.rs:56:49 | 56 | pub fn run_initial(&mut self, input_values: &Vec<u64>) { | ^^^^^^^^^ help: change this to: `&[u64]` | = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#ptr_arg
this boolean expression can be simplified: src/sim/fault.rs#L48
warning: this boolean expression can be simplified --> src/sim/fault.rs:48:24 | 48 | ret.retain(|f| !redundant.binary_search(f).is_ok()); | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: try: `redundant.binary_search(f).is_err()` | = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#nonminimal_bool = note: `#[warn(clippy::nonminimal_bool)]` on by default
this expression creates a reference which is immediately dereferenced by the compiler: src/optim/share_logic.rs#L344
warning: this expression creates a reference which is immediately dereferenced by the compiler --> src/optim/share_logic.rs:344:24 | 344 | *aig = factor_nary(&aig); | ^^^^ help: change this to: `aig` | = 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/optim/share_logic.rs#L343
warning: this expression creates a reference which is immediately dereferenced by the compiler --> src/optim/share_logic.rs:343:25 | 343 | *aig = flatten_nary(&aig, flattening_limit); | ^^^^ help: change this to: `aig` | = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_borrow
redundant closure: src/optim/share_logic.rs#L335
warning: redundant closure --> src/optim/share_logic.rs:335:52 | 335 | let aig2 = factor_gates(&aig1, |g| g.is_xor(), |a, b| Gate::xor(a, b)); | ^^^^^^^^^^^^^^^^^^^^^^ help: replace the closure with the function itself: `Gate::xor` | = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#redundant_closure
redundant closure: src/optim/share_logic.rs#L334
warning: redundant closure --> src/optim/share_logic.rs:334:50 | 334 | let aig1 = factor_gates(aig, |g| g.is_and(), |a, b| Gate::and(a, b)); | ^^^^^^^^^^^^^^^^^^^^^^ help: replace the closure with the function itself: `Gate::and` | = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#redundant_closure
returning the result of a `let` binding from a block: src/optim/share_logic.rs#L336
warning: returning the result of a `let` binding from a block --> src/optim/share_logic.rs:336:5 | 335 | let aig2 = factor_gates(&aig1, |g| g.is_xor(), |a, b| Gate::xor(a, b)); | ----------------------------------------------------------------------- unnecessary `let` binding 336 | aig2 | ^^^^ | = 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 | 335 ~ 336 ~ factor_gates(&aig1, |g| g.is_xor(), |a, b| Gate::xor(a, b)) |
the loop variable `i` is used to index `visited`: src/network/network.rs#L321
warning: the loop variable `i` is used to index `visited` --> src/network/network.rs:321:18 | 321 | for i in 0..self.nb_nodes() { | ^^^^^^^^^^^^^^^^^^ | = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_range_loop help: consider using an iterator and enumerate() | 321 | for (i, <item>) in visited.iter_mut().enumerate().take(self.nb_nodes()) { | ~~~~~~~~~~~ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
the loop variable `i` is only used to index `new_nodes`: src/network/network.rs#L289
warning: the loop variable `i` is only used to index `new_nodes` --> src/network/network.rs:289:18 | 289 | for i in 0..new_nodes.len() { | ^^^^^^^^^^^^^^^^^^ | = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_range_loop help: consider using an iterator | 289 | for <item> in &mut new_nodes { | ~~~~~~ ~~~~~~~~~~~~~~
the loop variable `i` is used to index `translation`: src/network/network.rs#L273
warning: the loop variable `i` is used to index `translation` --> src/network/network.rs:273:18 | 273 | for i in 0..self.nb_nodes() { | ^^^^^^^^^^^^^^^^^^ | = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_range_loop help: consider using an iterator and enumerate() | 273 | for (i, <item>) in translation.iter_mut().enumerate().take(self.nb_nodes()) { | ~~~~~~~~~~~ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
module has the same name as its containing module: src/network.rs#L7
warning: module has the same name as its containing module --> src/network.rs:7:1 | 7 | mod network; | ^^^^^^^^^^^^ | = 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
redundant closure: src/network/gates.rs#L280
warning: redundant closure --> src/network/gates.rs:280:47 | 280 | inputs: lut.inputs.iter().map(|s| t(s)).collect(), | ^^^^^^^^ help: replace the closure with the function itself: `t` | = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#redundant_closure
redundant closure: src/network/gates.rs#L277
warning: redundant closure --> src/network/gates.rs:277:46 | 277 | Nary(v, tp) => Nary(v.iter().map(|s| t(s)).collect(), *tp), | ^^^^^^^^ help: replace the closure with the function itself: `t` | = 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
unneeded `return` statement: src/network/gates.rs#L267
warning: unneeded `return` statement --> src/network/gates.rs:267:9 | 267 | return matches!(self, Gate::Buf(_)); | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ | = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_return help: remove `return` | 267 - return matches!(self, Gate::Buf(_)); 267 + matches!(self, Gate::Buf(_)) |
unneeded `return` statement: src/network/gates.rs#L256
warning: unneeded `return` statement --> src/network/gates.rs:256:9 | 256 | / return matches!( 257 | | self, 258 | | Gate::Binary(_, BinaryType::Xor) 259 | | | Gate::Ternary(_, TernaryType::Xor) 260 | | | Gate::Nary(_, NaryType::Xor) 261 | | | Gate::Nary(_, NaryType::Xnor) 262 | | ); | |_________^ | = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_return help: remove `return` | 256 ~ matches!( 257 + self, 258 + Gate::Binary(_, BinaryType::Xor) 259 + | Gate::Ternary(_, TernaryType::Xor) 260 + | Gate::Nary(_, NaryType::Xor) 261 + | Gate::Nary(_, NaryType::Xnor) 262 ~ ) |
unneeded `return` statement: src/network/gates.rs#L243
warning: unneeded `return` statement --> src/network/gates.rs:243:9 | 243 | / return matches!( 244 | | self, 245 | | Gate::Binary(_, BinaryType::And) 246 | | | Gate::Ternary(_, TernaryType::And) ... | 250 | | | Gate::Nary(_, NaryType::Nor) 251 | | ); | |_________^ | = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_return help: remove `return` | 243 ~ matches!( 244 + self, 245 + Gate::Binary(_, BinaryType::And) 246 + | Gate::Ternary(_, TernaryType::And) 247 + | Gate::Nary(_, NaryType::And) 248 + | Gate::Nary(_, NaryType::Nand) 249 + | Gate::Nary(_, NaryType::Or) 250 + | Gate::Nary(_, NaryType::Nor) 251 ~ ) |
unneeded `return` statement: src/network/gates.rs#L233
warning: unneeded `return` statement --> src/network/gates.rs:233:9 | 233 | / return matches!( 234 | | self, 235 | | Gate::Binary(_, BinaryType::Xor) 236 | | | Gate::Ternary(_, TernaryType::Xor) 237 | | | Gate::Nary(_, NaryType::Xor) 238 | | ); | |_________^ | = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_return help: remove `return` | 233 ~ matches!( 234 + self, 235 + Gate::Binary(_, BinaryType::Xor) 236 + | Gate::Ternary(_, TernaryType::Xor) 237 + | Gate::Nary(_, NaryType::Xor) 238 ~ ) |
unneeded `return` statement: src/network/gates.rs#L223
warning: unneeded `return` statement --> src/network/gates.rs:223:9 | 223 | / return matches!( 224 | | self, 225 | | Gate::Binary(_, BinaryType::And) 226 | | | Gate::Ternary(_, TernaryType::And) 227 | | | Gate::Nary(_, NaryType::And) 228 | | ); | |_________^ | = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_return help: remove `return` | 223 ~ matches!( 224 + self, 225 + Gate::Binary(_, BinaryType::And) 226 + | Gate::Ternary(_, TernaryType::And) 227 + | Gate::Nary(_, NaryType::And) 228 ~ ) |
unneeded `return` statement: src/network/gates.rs#L218
warning: unneeded `return` statement --> src/network/gates.rs:218:9 | 218 | return !matches!(self, Gate::Dff(_)); | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ | = 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` | 218 - return !matches!(self, Gate::Dff(_)); 218 + !matches!(self, Gate::Dff(_)) |
writing `&Vec` instead of `&[_]` involves a new object where a slice will do: src/io/patterns.rs#L97
warning: writing `&Vec` instead of `&[_]` involves a new object where a slice will do --> src/io/patterns.rs:97:54 | 97 | pub fn write_patterns<W: Write>(w: &mut W, patterns: &Vec<Vec<Vec<bool>>>) { | ^^^^^^^^^^^^^^^^^^^^ help: change this to: `&[Vec<Vec<bool>>]` | = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#ptr_arg
unnecessary `if let` since only the `Ok` variant of the iterator element is used: src/io/patterns.rs#L28
warning: unnecessary `if let` since only the `Ok` variant of the iterator element is used --> src/io/patterns.rs:28:5 | 28 | for l in BufReader::new(r).lines() { | ^ ------------------------- help: try: `BufReader::new(r).lines().flatten()` | _____| | | 29 | | if let Ok(s) = l { 30 | | line_ind += 1; 31 | | let t = s.trim(); ... | 76 | | } 77 | | } | |_____^ | help: ...and remove the `if let` statement in the for loop --> src/io/patterns.rs:29:9 | 29 | / if let Ok(s) = l { 30 | | line_ind += 1; 31 | | let t = s.trim(); 32 | | if t.is_empty() || t.starts_with('*') { ... | 75 | | } 76 | | } | |_________^ = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#manual_flatten
single-character string constant used as pattern: src/io/blif.rs#L258
warning: single-character string constant used as pattern --> src/io/blif.rs:258:73 | 258 | let is_continuation = comment_pos.is_none() && ss.ends_with("\\"); | ^^^^ help: try using a `char` instead: `'\\'` | = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#single_char_pattern
unnecessary `if let` since only the `Ok` variant of the iterator element is used: src/io/blif.rs#L249
warning: unnecessary `if let` since only the `Ok` variant of the iterator element is used --> src/io/blif.rs:249:5 | 249 | for l in BufReader::new(r).lines() { | ^ ------------------------- help: try: `BufReader::new(r).lines().flatten()` | _____| | | 250 | | if let Ok(s) = l { 251 | | // TODO: parse comments properly, not just at the beginning of the line 252 | | let comment_pos = s.find('#'); ... | 273 | | } 274 | | } | |_____^ | help: ...and remove the `if let` statement in the for loop --> src/io/blif.rs:250:9 | 250 | / if let Ok(s) = l { 251 | | // TODO: parse comments properly, not just at the beginning of the line 252 | | let comment_pos = s.find('#'); 253 | | ... | 272 | | ss.clear(); 273 | | } | |_________^ = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#manual_flatten = note: `#[warn(clippy::manual_flatten)]` on by default
single-character string constant used as pattern: src/io/blif.rs#L234
warning: single-character string constant used as pattern --> src/io/blif.rs:234:38 | 234 | if tokens[0].starts_with(".") { | ^^^ help: try using a `char` instead: `'.'` | = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#single_char_pattern
length comparison to zero: src/io/blif.rs#L180
warning: length comparison to zero --> src/io/blif.rs:180:20 | 180 | if deps.len() == 0 { | ^^^^^^^^^^^^^^^ help: using `is_empty` is clearer and more explicit: `deps.is_empty()` | = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#len_zero
length comparison to zero: src/io/blif.rs#L172
warning: length comparison to zero --> src/io/blif.rs:172:20 | 172 | if deps.len() == 0 { | ^^^^^^^^^^^^^^^ help: using `is_empty` is clearer and more explicit: `deps.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
casting a character literal to `u8` truncates: src/io/blif.rs#L161
warning: casting a character literal to `u8` truncates --> src/io/blif.rs:161:33 | 161 | } else if *c != '-' as u8 { | ^^^^^^^^^ help: use a byte literal instead: `b'-'` | = note: `char` is four bytes wide, but `u8` is a single byte = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#char_lit_as_u8
casting a character literal to `u8` truncates: src/io/blif.rs#L159
warning: casting a character literal to `u8` truncates --> src/io/blif.rs:159:33 | 159 | } else if *c == '1' as u8 { | ^^^^^^^^^ help: use a byte literal instead: `b'1'` | = note: `char` is four bytes wide, but `u8` is a single byte = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#char_lit_as_u8
casting a character literal to `u8` truncates: src/io/blif.rs#L157
warning: casting a character literal to `u8` truncates --> src/io/blif.rs:157:26 | 157 | if *c == '0' as u8 { | ^^^^^^^^^ help: use a byte literal instead: `b'0'` | = note: `char` is four bytes wide, but `u8` is a single byte = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#char_lit_as_u8 = note: `#[warn(clippy::char_lit_as_u8)]` on by default
the loop variable `j` is only used to index `statements`: src/io/blif.rs#L128
warning: the loop variable `j` is only used to index `statements` --> src/io/blif.rs:128:18 | 128 | for j in (i + 1)..statements.len() { | ^^^^^^^^^^^^^^^^^^^^^^^^^ | = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_range_loop help: consider using an iterator | 128 | for <item> in statements.iter().skip((i + 1)) { | ~~~~~~ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
you seem to use `.enumerate()` and immediately discard the index: src/io/blif.rs#L45
warning: you seem to use `.enumerate()` and immediately discard the index --> src/io/blif.rs:45:34 | 45 | for (_, name) in inputs.iter().enumerate() { | ^^^^^^^^^^^^^^^^^^^^^^^^^ | = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#unused_enumerate_index = note: `#[warn(clippy::unused_enumerate_index)]` on by default help: remove the `.enumerate()` call | 45 | for name in inputs.iter() { | ~~~~ ~~~~~~~~~~~~~
single-character string constant used as pattern: src/io/bench.rs#L181
warning: single-character string constant used as pattern --> src/io/bench.rs:181:28 | 181 | if !t.contains("=") { | ^^^ help: try using a `char` instead: `'='` | = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#single_char_pattern = note: `#[warn(clippy::single_char_pattern)]` on by default
writing `&Vec` instead of `&[_]` involves a new object where a slice will do: src/io/bench.rs#L58
warning: writing `&Vec` instead of `&[_]` involves a new object where a slice will do --> src/io/bench.rs:58:16 | 58 | statement: &Vec<String>, | ^^^^^^^^^^^^ help: change this to: `&[String]` | = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#ptr_arg
writing `&Vec` instead of `&[_]` involves a new object where a slice will do: src/io/bench.rs#L41
warning: writing `&Vec` instead of `&[_]` involves a new object where a slice will do --> src/io/bench.rs:41:31 | 41 | fn check_statement(statement: &Vec<String>, name_to_sig: &HashMap<String, Signal>) { | ^^^^^^^^^^^^ help: change this to: `&[String]` | = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#ptr_arg
`to_string` applied to a type that implements `Display` in `assert!` args: src/io/bench.rs#L28
warning: `to_string` applied to a type that implements `Display` in `assert!` args --> src/io/bench.rs:28:54 | 28 | assert!(!present, "{} is defined twice", s[0].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/io/bench.rs#L15
warning: writing `&Vec` instead of `&[_]` involves a new object where a slice will do --> src/io/bench.rs:15:13 | 15 | inputs: &Vec<String>, | ^^^^^^^^^^^^ help: change this to: `&[String]` | = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#ptr_arg
writing `&Vec` instead of `&[_]` involves a new object where a slice will do: src/io/bench.rs#L14
warning: writing `&Vec` instead of `&[_]` involves a new object where a slice will do --> src/io/bench.rs:14:17 | 14 | statements: &Vec<Vec<String>>, | ^^^^^^^^^^^^^^^^^ help: change this to: `&[Vec<String>]` | = 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
match expression looks like `matches!` macro: src/equiv.rs#L317
warning: match expression looks like `matches!` macro --> src/equiv.rs:317:25 | 317 | let b = match sol.lit_value(t[&Signal::from_input(inp as u32)]) { | _________________________^ 318 | | TernaryVal::True => true, 319 | | _ => false, 320 | | }; | |_________________^ help: try: `matches!(sol.lit_value(t[&Signal::from_input(inp as u32)]), TernaryVal::True)` | = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#match_like_matches_macro = note: `#[warn(clippy::match_like_matches_macro)]` on by default
the variable `i` is used as a loop counter: src/equiv.rs#L292
warning: the variable `i` is used as a loop counter --> src/equiv.rs:292:5 | 292 | for s in all_lits { | ^^^^^^^^^^^^^^^^^ help: consider using: `for (i, s) in (0_u32..).zip(all_lits.into_iter())` | = note: `i` is of type `u32`, making it ineligible for `Iterator::enumerate` = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#explicit_counter_loop = note: `#[warn(clippy::explicit_counter_loop)]` on by default
the loop variable `i` is used to index `v`: src/equiv.rs#L72
warning: the loop variable `i` is used to index `v` --> src/equiv.rs:72:18 | 72 | for i in 0..lut.num_vars() { | ^^^^^^^^^^^^^^^^^ | = 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() | 72 | for (i, <item>) in v.iter().enumerate().take(lut.num_vars()) { | ~~~~~~~~~~~ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
useless use of `format!`: src/atpg.rs#L250
warning: useless use of `format!` --> src/atpg.rs:250:30 | 250 | progress.set_postfix(format!("patterns=-")); | ^^^^^^^^^^^^^^^^^^^^^ help: consider using `.to_string()`: `"patterns=-".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
this expression creates a reference which is immediately dereferenced by the compiler: src/atpg.rs#L80
warning: this expression creates a reference which is immediately dereferenced by the compiler --> src/atpg.rs:80:40 | 80 | assert_eq!(detects_faults(aig, &pattern, &vec![fault]), vec![true]); | ^^^^^^^^ help: change this to: `pattern` | = 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
this `else { if .. }` block can be collapsed: src/io/blif.rs#L179
warning: this `else { if .. }` block can be collapsed --> src/io/blif.rs:179:20 | 179 | } else { | ____________________^ 180 | | if deps.len() == 0 { 181 | | Gate::Buf(Signal::zero()) 182 | | } else if deps.len() == 1 { ... | 186 | | } 187 | | }; | |_____________^ | = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#collapsible_else_if = note: `#[warn(clippy::collapsible_else_if)]` on by default help: collapse nested if block | 179 ~ } else if deps.len() == 0 { 180 + Gate::Buf(Signal::zero()) 181 + } else if deps.len() == 1 { 182 + Gate::Buf(!deps[0]) 183 + } else { 184 + Gate::Nary(deps.into(), NaryType::Nand) 185 ~ }; |
redundant field names in struct initialization: src/atpg.rs#L147
warning: redundant field names in struct initialization --> src/atpg.rs:147:13 | 147 | faults: faults, | ^^^^^^^^^^^^^^ help: replace it with: `faults` | = 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
Clippy
Node.js 16 actions are deprecated. Please update the following actions to use Node.js 20: actions-rs/toolchain@v1, actions-rs/clippy-check@v1. For more information see: https://github.blog/changelog/2023-09-22-github-actions-transitioning-from-node-16-to-node-20/.
Clippy
The following actions uses node12 which is deprecated and will be forced to run on node16: actions-rs/toolchain@v1, actions-rs/clippy-check@v1. For more info: https://github.blog/changelog/2023-06-13-github-actions-all-actions-will-run-on-node16-instead-of-node12-by-default/
Clippy
The `set-output` command is deprecated and will be disabled soon. Please upgrade to using Environment Files. For more information see: https://github.blog/changelog/2022-10-11-github-actions-deprecating-save-state-and-set-output-commands/
Clippy
The `set-output` command is deprecated and will be disabled soon. Please upgrade to using Environment Files. For more information see: https://github.blog/changelog/2022-10-11-github-actions-deprecating-save-state-and-set-output-commands/
Clippy
The `set-output` command is deprecated and will be disabled soon. Please upgrade to using Environment Files. For more information see: https://github.blog/changelog/2022-10-11-github-actions-deprecating-save-state-and-set-output-commands/
Clippy
The `set-output` command is deprecated and will be disabled soon. Please upgrade to using Environment Files. For more information see: https://github.blog/changelog/2022-10-11-github-actions-deprecating-save-state-and-set-output-commands/
Test (ubuntu-latest)
Node.js 16 actions are deprecated. Please update the following actions to use Node.js 20: actions-rs/toolchain@v1, actions-rs/cargo@v1. For more information see: https://github.blog/changelog/2023-09-22-github-actions-transitioning-from-node-16-to-node-20/.
Test (ubuntu-latest)
The following actions uses node12 which is deprecated and will be forced to run on node16: actions-rs/toolchain@v1, actions-rs/cargo@v1. For more info: https://github.blog/changelog/2023-06-13-github-actions-all-actions-will-run-on-node16-instead-of-node12-by-default/
Test (ubuntu-latest)
The `set-output` command is deprecated and will be disabled soon. Please upgrade to using Environment Files. For more information see: https://github.blog/changelog/2022-10-11-github-actions-deprecating-save-state-and-set-output-commands/
Test (ubuntu-latest)
The `set-output` command is deprecated and will be disabled soon. Please upgrade to using Environment Files. For more information see: https://github.blog/changelog/2022-10-11-github-actions-deprecating-save-state-and-set-output-commands/
Test (ubuntu-latest)
The `set-output` command is deprecated and will be disabled soon. Please upgrade to using Environment Files. For more information see: https://github.blog/changelog/2022-10-11-github-actions-deprecating-save-state-and-set-output-commands/
Test (ubuntu-latest)
The `set-output` command is deprecated and will be disabled soon. Please upgrade to using Environment Files. For more information see: https://github.blog/changelog/2022-10-11-github-actions-deprecating-save-state-and-set-output-commands/
Test (macos-latest)
Node.js 16 actions are deprecated. Please update the following actions to use Node.js 20: actions-rs/toolchain@v1, actions-rs/cargo@v1. For more information see: https://github.blog/changelog/2023-09-22-github-actions-transitioning-from-node-16-to-node-20/.
Test (macos-latest)
The following actions uses node12 which is deprecated and will be forced to run on node16: actions-rs/toolchain@v1, actions-rs/cargo@v1. For more info: https://github.blog/changelog/2023-06-13-github-actions-all-actions-will-run-on-node16-instead-of-node12-by-default/
Test (macos-latest)
The `set-output` command is deprecated and will be disabled soon. Please upgrade to using Environment Files. For more information see: https://github.blog/changelog/2022-10-11-github-actions-deprecating-save-state-and-set-output-commands/
Test (macos-latest)
The `set-output` command is deprecated and will be disabled soon. Please upgrade to using Environment Files. For more information see: https://github.blog/changelog/2022-10-11-github-actions-deprecating-save-state-and-set-output-commands/
Test (macos-latest)
The `set-output` command is deprecated and will be disabled soon. Please upgrade to using Environment Files. For more information see: https://github.blog/changelog/2022-10-11-github-actions-deprecating-save-state-and-set-output-commands/
Test (macos-latest)
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/