Export Lut and Xor to Blif #147
Annotations
89 warnings
writing `&Vec` instead of `&[_]` involves a new object where a slice will do:
src/sim.rs#L103
warning: writing `&Vec` instead of `&[_]` involves a new object where a slice will do
--> src/sim.rs:103:54
|
103 | 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#L58
warning: writing `&Vec` instead of `&[_]` involves a new object where a slice will do
--> src/sim.rs:58:19
|
58 | 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
|
58 ~ input_values: &[bool],
59 | faults: &Vec<Fault>,
60 | ) -> Vec<bool> {
61 | assert!(a.is_comb());
62 ~ let input = vec![input_values.to_owned()];
|
|
writing `&Vec` instead of `&[_]` involves a new object where a slice will do:
src/sim.rs#L37
warning: writing `&Vec` instead of `&[_]` involves a new object where a slice will do
--> src/sim.rs:37:49
|
37 | 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
|
37 ~ pub fn simulate_comb(a: &Network, input_values: &[bool]) -> Vec<bool> {
38 | assert!(a.is_comb());
39 ~ 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#L53
warning: writing `&Vec` instead of `&[_]` involves a new object where a slice will do
--> src/sim/incremental_sim.rs:53:49
|
53 | 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#L47
warning: this boolean expression can be simplified
--> src/sim/fault.rs:47:24
|
47 | 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#L343
warning: this expression creates a reference which is immediately dereferenced by the compiler
--> src/optim/share_logic.rs:343:24
|
343 | *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#L342
warning: this expression creates a reference which is immediately dereferenced by the compiler
--> src/optim/share_logic.rs:342:25
|
342 | *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#L334
warning: redundant closure
--> src/optim/share_logic.rs:334:52
|
334 | 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#L333
warning: redundant closure
--> src/optim/share_logic.rs:333:50
|
333 | 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#L335
warning: returning the result of a `let` binding from a block
--> src/optim/share_logic.rs:335:5
|
334 | let aig2 = factor_gates(&aig1, |g| g.is_xor(), |a, b| Gate::xor(a, b));
| ----------------------------------------------------------------------- unnecessary `let` binding
335 | 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
|
334 ~
335 ~ 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#L88
warning: writing `&Vec` instead of `&[_]` involves a new object where a slice will do
--> src/io/patterns.rs:88:54
|
88 | 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#L27
warning: unnecessary `if let` since only the `Ok` variant of the iterator element is used
--> src/io/patterns.rs:27:5
|
27 | for l in BufReader::new(r).lines() {
| ^ ------------------------- help: try: `BufReader::new(r).lines().flatten()`
| _____|
| |
28 | | if let Ok(s) = l {
29 | | let t = s.trim();
30 | | if t.is_empty() || t.starts_with('*') {
... |
64 | | }
65 | | }
| |_____^
|
help: ...and remove the `if let` statement in the for loop
--> src/io/patterns.rs:28:9
|
28 | / if let Ok(s) = l {
29 | | let t = s.trim();
30 | | if t.is_empty() || t.starts_with('*') {
31 | | continue;
... |
63 | | ret.push(seq_ret);
64 | | }
| |_________^
= 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/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
|
the loop variable `i` is used to index `v`:
src/equiv.rs#L67
warning: the loop variable `i` is used to index `v`
--> src/equiv.rs:67:18
|
67 | 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()
|
67 | 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
|
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#L103
warning: writing `&Vec` instead of `&[_]` involves a new object where a slice will do
--> src/sim.rs:103:54
|
103 | 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#L58
warning: writing `&Vec` instead of `&[_]` involves a new object where a slice will do
--> src/sim.rs:58:19
|
58 | 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
|
58 ~ input_values: &[bool],
59 | faults: &Vec<Fault>,
60 | ) -> Vec<bool> {
61 | assert!(a.is_comb());
62 ~ let input = vec![input_values.to_owned()];
|
|
writing `&Vec` instead of `&[_]` involves a new object where a slice will do:
src/sim.rs#L37
warning: writing `&Vec` instead of `&[_]` involves a new object where a slice will do
--> src/sim.rs:37:49
|
37 | 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
|
37 ~ pub fn simulate_comb(a: &Network, input_values: &[bool]) -> Vec<bool> {
38 | assert!(a.is_comb());
39 ~ 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#L53
warning: writing `&Vec` instead of `&[_]` involves a new object where a slice will do
--> src/sim/incremental_sim.rs:53:49
|
53 | 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#L47
warning: this boolean expression can be simplified
--> src/sim/fault.rs:47:24
|
47 | 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#L343
warning: this expression creates a reference which is immediately dereferenced by the compiler
--> src/optim/share_logic.rs:343:24
|
343 | *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#L342
warning: this expression creates a reference which is immediately dereferenced by the compiler
--> src/optim/share_logic.rs:342:25
|
342 | *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#L334
warning: redundant closure
--> src/optim/share_logic.rs:334:52
|
334 | 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#L333
warning: redundant closure
--> src/optim/share_logic.rs:333:50
|
333 | 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#L335
warning: returning the result of a `let` binding from a block
--> src/optim/share_logic.rs:335:5
|
334 | let aig2 = factor_gates(&aig1, |g| g.is_xor(), |a, b| Gate::xor(a, b));
| ----------------------------------------------------------------------- unnecessary `let` binding
335 | 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
|
334 ~
335 ~ 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#L88
warning: writing `&Vec` instead of `&[_]` involves a new object where a slice will do
--> src/io/patterns.rs:88:54
|
88 | 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#L27
warning: unnecessary `if let` since only the `Ok` variant of the iterator element is used
--> src/io/patterns.rs:27:5
|
27 | for l in BufReader::new(r).lines() {
| ^ ------------------------- help: try: `BufReader::new(r).lines().flatten()`
| _____|
| |
28 | | if let Ok(s) = l {
29 | | let t = s.trim();
30 | | if t.is_empty() || t.starts_with('*') {
... |
64 | | }
65 | | }
| |_____^
|
help: ...and remove the `if let` statement in the for loop
--> src/io/patterns.rs:28:9
|
28 | / if let Ok(s) = l {
29 | | let t = s.trim();
30 | | if t.is_empty() || t.starts_with('*') {
31 | | continue;
... |
63 | | ret.push(seq_ret);
64 | | }
| |_________^
= 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/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
|
the loop variable `i` is used to index `v`:
src/equiv.rs#L67
warning: the loop variable `i` is used to index `v`
--> src/equiv.rs:67:18
|
67 | 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()
|
67 | 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
|
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
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)
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)
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/
|