Skip to content

#5 - Add more action #1

#5 - Add more action

#5 - Add more action #1

GitHub Actions / Clippy Output succeeded Nov 28, 2023 in 0s

Clippy Output

13 warnings

Details

Results

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

Versions

  • rustc 1.74.0 (79e9716c9 2023-11-13)
  • cargo 1.74.0 (ecb9851af 2023-10-18)
  • clippy 0.1.74 (79e9716 2023-11-13)

Annotations

Check warning on line 44 in src/wire.rs

See this annotation in the file changed.

@github-actions github-actions / Clippy Output

the borrowed expression implements the required traits

warning: the borrowed expression implements the required traits
  --> src/wire.rs:44:25
   |
44 |             .push_slice(&self.hashes[1].to_le_bytes())
   |                         ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: change this to: `self.hashes[1].to_le_bytes()`
   |
   = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_borrows_for_generic_args

Check warning on line 41 in src/wire.rs

See this annotation in the file changed.

@github-actions github-actions / Clippy Output

the borrowed expression implements the required traits

warning: the borrowed expression implements the required traits
  --> src/wire.rs:41:25
   |
41 |             .push_slice(&self.hashes[0].to_le_bytes())
   |                         ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: change this to: `self.hashes[0].to_le_bytes()`
   |
   = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_borrows_for_generic_args
   = note: `#[warn(clippy::needless_borrows_for_generic_args)]` on by default

Check warning on line 33 in src/wire.rs

See this annotation in the file changed.

@github-actions github-actions / Clippy Output

unneeded `return` statement

warning: unneeded `return` statement
  --> src/wire.rs:29:9
   |
29 | /         return Wire {
30 | |             preimages: Some([preimage1, preimage2]),
31 | |             hashes: [hash1, hash2],
32 | |             selector: None,
33 | |         };
   | |_________^
   |
   = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_return
help: remove `return`
   |
29 ~         Wire {
30 +             preimages: Some([preimage1, preimage2]),
31 +             hashes: [hash1, hash2],
32 +             selector: None,
33 ~         }
   |

Check warning on line 34 in src/wire.rs

See this annotation in the file changed.

@github-actions github-actions / Clippy Output

you should consider adding a `Default` implementation for `Wire`

warning: you should consider adding a `Default` implementation for `Wire`
  --> src/wire.rs:18:5
   |
18 | /     pub fn new() -> Self {
19 | |         let mut rng = rand::thread_rng();
20 | |
21 | |         let preimage1 = Target::from_le_bytes(rng.gen());
...  |
33 | |         };
34 | |     }
   | |_____^
   |
   = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#new_without_default
help: try adding this
   |
17 + impl Default for Wire {
18 +     fn default() -> Self {
19 +         Self::new()
20 +     }
21 + }
   |

Check warning on line 61 in src/gates.rs

See this annotation in the file changed.

@github-actions github-actions / Clippy Output

unneeded `return` statement

warning: unneeded `return` statement
  --> src/gates.rs:61:9
   |
61 |         return "NotGate".to_string();
   |         ^^^^^^^^^^^^^^^^^^^^^^^^^^^^
   |
   = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_return
help: remove `return`
   |
61 -         return "NotGate".to_string();
61 +         "NotGate".to_string()
   |

Check warning on line 55 in src/gates.rs

See this annotation in the file changed.

@github-actions github-actions / Clippy Output

unneeded `return` statement

warning: unneeded `return` statement
  --> src/gates.rs:52:9
   |
52 | /         return XorGate {
53 | |             input_wires,
54 | |             output_wires,
55 | |         };
   | |_________^
   |
   = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_return
help: remove `return`
   |
52 ~         XorGate {
53 +             input_wires,
54 +             output_wires,
55 ~         }
   |

Check warning on line 41 in src/gates.rs

See this annotation in the file changed.

@github-actions github-actions / Clippy Output

unneeded `return` statement

warning: unneeded `return` statement
  --> src/gates.rs:41:9
   |
41 |         return "NotGate".to_string();
   |         ^^^^^^^^^^^^^^^^^^^^^^^^^^^^
   |
   = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_return
help: remove `return`
   |
41 -         return "NotGate".to_string();
41 +         "NotGate".to_string()
   |

Check warning on line 35 in src/gates.rs

See this annotation in the file changed.

@github-actions github-actions / Clippy Output

unneeded `return` statement

warning: unneeded `return` statement
  --> src/gates.rs:32:9
   |
32 | /         return AndGate {
33 | |             input_wires,
34 | |             output_wires,
35 | |         };
   | |_________^
   |
   = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_return
help: remove `return`
   |
32 ~         AndGate {
33 +             input_wires,
34 +             output_wires,
35 ~         }
   |

Check warning on line 21 in src/gates.rs

See this annotation in the file changed.

@github-actions github-actions / Clippy Output

unneeded `return` statement

warning: unneeded `return` statement
  --> src/gates.rs:21:9
   |
21 |         return "NotGate".to_string();
   |         ^^^^^^^^^^^^^^^^^^^^^^^^^^^^
   |
   = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_return
help: remove `return`
   |
21 -         return "NotGate".to_string();
21 +         "NotGate".to_string()
   |

Check warning on line 15 in src/gates.rs

See this annotation in the file changed.

@github-actions github-actions / Clippy Output

unneeded `return` statement

warning: unneeded `return` statement
  --> src/gates.rs:12:9
   |
12 | /         return NotGate {
13 | |             input_wires,
14 | |             output_wires,
15 | |         };
   | |_________^
   |
   = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_return
help: remove `return`
   |
12 ~         NotGate {
13 +             input_wires,
14 +             output_wires,
15 ~         }
   |

Check warning on line 57 in src/circuit.rs

See this annotation in the file changed.

@github-actions github-actions / Clippy Output

comparison to empty slice

warning: comparison to empty slice
  --> src/circuit.rs:57:27
   |
57 |                 } else if line_str != "" {
   |                           ^^^^^^^^^^^^^^ help: using `!is_empty` is clearer and more explicit: `!line_str.is_empty()`
   |
   = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#comparison_to_empty
   = note: `#[warn(clippy::comparison_to_empty)]` on by default

Check warning on line 24 in src/circuit.rs

See this annotation in the file changed.

@github-actions github-actions / Clippy Output

unneeded `return` statement

warning: unneeded `return` statement
  --> src/circuit.rs:19:9
   |
19 | /         return Circuit {
20 | |             input_sizes: vec![32, 32],
21 | |             output_sizes: vec![32],
22 | |             gates: vec![Box::new(NotGate::new(vec![], vec![]))],
23 | |             wires: vec![],
24 | |         };
   | |_________^
   |
   = 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`
   |
19 ~         Circuit {
20 +             input_sizes: vec![32, 32],
21 +             output_sizes: vec![32],
22 +             gates: vec![Box::new(NotGate::new(vec![], vec![]))],
23 +             wires: vec![],
24 ~         }
   |

Check warning on line 25 in src/circuit.rs

See this annotation in the file changed.

@github-actions github-actions / Clippy Output

you should consider adding a `Default` implementation for `Circuit`

warning: you should consider adding a `Default` implementation for `Circuit`
  --> src/circuit.rs:18:5
   |
18 | /     pub fn new() -> Self {
19 | |         return Circuit {
20 | |             input_sizes: vec![32, 32],
21 | |             output_sizes: vec![32],
...  |
24 | |         };
25 | |     }
   | |_____^
   |
   = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#new_without_default
   = note: `#[warn(clippy::new_without_default)]` on by default
help: try adding this
   |
17 + impl Default for Circuit {
18 +     fn default() -> Self {
19 +         Self::new()
20 +     }
21 + }
   |