refactor: remove unneeded println! #399
clippy
5 warnings
Details
Results
Message level | Amount |
---|---|
Internal compiler error | 0 |
Error | 0 |
Warning | 5 |
Note | 0 |
Help | 0 |
Versions
- rustc 1.77.0 (aedd173a2 2024-03-17)
- cargo 1.77.0 (3fe68eabf 2024-02-29)
- clippy 0.1.77 (aedd173 2024-03-17)
Annotations
Check warning on line 409 in src/net/live_fluereflow.rs
github-actions / clippy
useless use of `vec!`
warning: useless use of `vec!`
--> src/net/live_fluereflow.rs:403:24
|
403 | let summary_text = vec![
| ________________________^
404 | | format!("Active Flow Count: {}", active_flow_count),
405 | | format!(
406 | | "Recent Exported Time: {}",
407 | | microseconds_to_timestamp(recent_exported_time).as_str()
408 | | ),
409 | | ];
| |_____^
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#useless_vec
= note: `#[warn(clippy::useless_vec)]` on by default
help: you can use an array directly
|
403 ~ let summary_text = [format!("Active Flow Count: {}", active_flow_count),
404 + format!(
405 + "Recent Exported Time: {}",
406 + microseconds_to_timestamp(recent_exported_time).as_str()
407 ~ )];
|
Check warning on line 258 in src/cli.rs
github-actions / clippy
this `if` statement can be collapsed
warning: this `if` statement can be collapsed
--> src/cli.rs:249:5
|
249 | / if mode != "offline" {
250 | | if args.get_flag("list") {
251 | | println!("List of network interfaces");
252 | | println!("--------------------------");
... |
257 | | }
258 | | }
| |_____^
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#collapsible_if
= note: `#[warn(clippy::collapsible_if)]` on by default
help: collapse nested if block
|
249 ~ if mode != "offline" && args.get_flag("list") {
250 + println!("List of network interfaces");
251 + println!("--------------------------");
252 + for (i, device) in Device::list().unwrap().iter().enumerate() {
253 + println!("[{}] {}", i, device.name);
254 + }
255 + exit(0);
256 + }
|
Check warning on line 91 in fluereflow/src/types/fluereflow.rs
github-actions / clippy
this function has too many arguments (27/7)
warning: this function has too many arguments (27/7)
--> fluereflow/src/types/fluereflow.rs:63:5
|
63 | / pub fn new(
64 | | source: IpAddr,
65 | | destination: IpAddr,
66 | | d_pkts: u32,
... |
90 | | tos: u8,
91 | | ) -> FluereRecord {
| |_____________________^
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#too_many_arguments
= note: `#[warn(clippy::too_many_arguments)]` on by default
Check warning on line 98 in fluere-config/src/init.rs
github-actions / clippy
returning the result of a `let` binding from a block
warning: returning the result of a `let` binding from a block
--> fluere-config/src/init.rs:98:5
|
97 | let path_config = path_base.join("fluere");
| ------------------------------------------- unnecessary `let` binding
98 | path_config
| ^^^^^^^^^^^
|
= 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
|
97 ~
98 ~ path_base.join("fluere")
|
Check warning on line 25 in fluere-config/src/init.rs
github-actions / clippy
unneeded unit expression
warning: unneeded unit expression
--> fluere-config/src/init.rs:25:21
|
25 | ()
| ^^ help: remove the final `()`
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#unused_unit
= note: `#[warn(clippy::unused_unit)]` on by default