Skip to content

fix: change the code to use FluereError #107

fix: change the code to use FluereError

fix: change the code to use FluereError #107

GitHub Actions / clippy failed Jan 9, 2025 in 1s

clippy

46 errors, 5 warnings

Details

Results

Message level Amount
Internal compiler error 0
Error 46
Warning 5
Note 0
Help 0

Versions

  • rustc 1.83.0 (90b35a623 2024-11-26)
  • cargo 1.83.0 (5ffbef321 2024-10-29)
  • clippy 0.1.83 (90b35a6 2024-11-26)

Annotations

Check failure on line 187 in src/net/parser/keys.rs

See this annotation in the file changed.

@github-actions github-actions / clippy

used `unwrap()` on an `Option` value

error: used `unwrap()` on an `Option` value
   --> src/net/parser/keys.rs:187:22
    |
187 |             arp_keys(i.unwrap())?
    |                      ^^^^^^^^^^
    |
    = note: if this value is `None`, it will panic
    = help: consider using `expect()` to provide a better panic message
    = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#unwrap_used

Check failure on line 179 in src/net/parser/keys.rs

See this annotation in the file changed.

@github-actions github-actions / clippy

used `unwrap()` on an `Option` value

error: used `unwrap()` on an `Option` value
   --> src/net/parser/keys.rs:179:23
    |
179 |             vlan_keys(i.unwrap())?
    |                       ^^^^^^^^^^
    |
    = note: if this value is `None`, it will panic
    = help: consider using `expect()` to provide a better panic message
    = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#unwrap_used

Check failure on line 171 in src/net/parser/keys.rs

See this annotation in the file changed.

@github-actions github-actions / clippy

used `unwrap()` on an `Option` value

error: used `unwrap()` on an `Option` value
   --> src/net/parser/keys.rs:171:22
    |
171 |             arp_keys(i.unwrap())?
    |                      ^^^^^^^^^^
    |
    = note: if this value is `None`, it will panic
    = help: consider using `expect()` to provide a better panic message
    = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#unwrap_used

Check failure on line 161 in src/net/parser/keys.rs

See this annotation in the file changed.

@github-actions github-actions / clippy

used `unwrap()` on an `Option` value

error: used `unwrap()` on an `Option` value
   --> src/net/parser/keys.rs:161:23
    |
161 |             ipv4_keys(i.unwrap())?
    |                       ^^^^^^^^^^
    |
    = note: if this value is `None`, it will panic
    = help: consider using `expect()` to provide a better panic message
    = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#unwrap_used

Check failure on line 151 in src/net/parser/keys.rs

See this annotation in the file changed.

@github-actions github-actions / clippy

used `unwrap()` on an `Option` value

error: used `unwrap()` on an `Option` value
   --> src/net/parser/keys.rs:151:23
    |
151 |             ipv6_keys(i.unwrap())?
    |                       ^^^^^^^^^^
    |
    = note: if this value is `None`, it will panic
    = help: consider using `expect()` to provide a better panic message
    = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#unwrap_used

Check failure on line 111 in src/net/parser/keys.rs

See this annotation in the file changed.

@github-actions github-actions / clippy

used `unwrap()` on an `Option` value

error: used `unwrap()` on an `Option` value
   --> src/net/parser/keys.rs:111:32
    |
111 |                 UdpPacket::new(i.unwrap().payload())
    |                                ^^^^^^^^^^
    |
    = note: if this value is `None`, it will panic
    = help: consider using `expect()` to provide a better panic message
    = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#unwrap_used

Check failure on line 112 in src/net/parser/keys.rs

See this annotation in the file changed.

@github-actions github-actions / clippy

used `unwrap()` on an `Option` value

error: used `unwrap()` on an `Option` value
   --> src/net/parser/keys.rs:111:17
    |
111 | /                 UdpPacket::new(i.unwrap().payload())
112 | |                     .unwrap()
    | |_____________________________^
    |
    = note: if this value is `None`, it will panic
    = help: consider using `expect()` to provide a better panic message
    = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#unwrap_used

Check failure on line 100 in src/net/parser/keys.rs

See this annotation in the file changed.

@github-actions github-actions / clippy

used `unwrap()` on an `Option` value

error: used `unwrap()` on an `Option` value
   --> src/net/parser/keys.rs:100:32
    |
100 |                 UdpPacket::new(i.unwrap().payload())
    |                                ^^^^^^^^^^
    |
    = note: if this value is `None`, it will panic
    = help: consider using `expect()` to provide a better panic message
    = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#unwrap_used

Check failure on line 101 in src/net/parser/keys.rs

See this annotation in the file changed.

@github-actions github-actions / clippy

used `unwrap()` on an `Option` value

error: used `unwrap()` on an `Option` value
   --> src/net/parser/keys.rs:100:17
    |
100 | /                 UdpPacket::new(i.unwrap().payload())
101 | |                     .unwrap()
    | |_____________________________^
    |
    = note: if this value is `None`, it will panic
    = help: consider using `expect()` to provide a better panic message
    = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#unwrap_used

Check failure on line 89 in src/net/parser/keys.rs

See this annotation in the file changed.

@github-actions github-actions / clippy

used `unwrap()` on an `Option` value

error: used `unwrap()` on an `Option` value
  --> src/net/parser/keys.rs:89:32
   |
89 |                 UdpPacket::new(i.unwrap().payload())
   |                                ^^^^^^^^^^
   |
   = note: if this value is `None`, it will panic
   = help: consider using `expect()` to provide a better panic message
   = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#unwrap_used

Check failure on line 90 in src/net/parser/keys.rs

See this annotation in the file changed.

@github-actions github-actions / clippy

used `unwrap()` on an `Option` value

error: used `unwrap()` on an `Option` value
  --> src/net/parser/keys.rs:89:17
   |
89 | /                 UdpPacket::new(i.unwrap().payload())
90 | |                     .unwrap()
   | |_____________________________^
   |
   = note: if this value is `None`, it will panic
   = help: consider using `expect()` to provide a better panic message
   = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#unwrap_used

Check failure on line 70 in src/net/parser/keys.rs

See this annotation in the file changed.

@github-actions github-actions / clippy

used `unwrap()` on an `Option` value

error: used `unwrap()` on an `Option` value
  --> src/net/parser/keys.rs:70:41
   |
70 |             let is_udp = UdpPacket::new(i.unwrap().payload()).is_some();
   |                                         ^^^^^^^^^^
   |
   = note: if this value is `None`, it will panic
   = help: consider using `expect()` to provide a better panic message
   = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#unwrap_used

Check failure on line 60 in src/net/parser/keys.rs

See this annotation in the file changed.

@github-actions github-actions / clippy

used `unwrap()` on an `Option` value

error: used `unwrap()` on an `Option` value
  --> src/net/parser/keys.rs:60:41
   |
60 |             let is_udp = UdpPacket::new(i.unwrap().payload()).is_some();
   |                                         ^^^^^^^^^^
   |
   = note: if this value is `None`, it will panic
   = help: consider using `expect()` to provide a better panic message
   = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#unwrap_used

Check failure on line 50 in src/net/parser/keys.rs

See this annotation in the file changed.

@github-actions github-actions / clippy

used `unwrap()` on an `Option` value

error: used `unwrap()` on an `Option` value
  --> src/net/parser/keys.rs:50:41
   |
50 |             let is_udp = UdpPacket::new(i.unwrap().payload()).is_some();
   |                                         ^^^^^^^^^^
   |
   = note: if this value is `None`, it will panic
   = help: consider using `expect()` to provide a better panic message
   = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#unwrap_used

Check failure on line 32 in src/net/parser/keys.rs

See this annotation in the file changed.

@github-actions github-actions / clippy

the function has a cognitive complexity of (35/10)

error: the function has a cognitive complexity of (35/10)
  --> src/net/parser/keys.rs:32:8
   |
32 | pub fn parse_keys(packet: pcap::Packet) -> Result<(Key, Key), NetError> {
   |        ^^^^^^^^^^
   |
   = help: you could split it up into multiple smaller functions
   = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#cognitive_complexity

Check failure on line 28 in src/net/parser/fluereflows.rs

See this annotation in the file changed.

@github-actions github-actions / clippy

the function has a cognitive complexity of (15/10)

error: the function has a cognitive complexity of (15/10)
  --> src/net/parser/fluereflows.rs:28:8
   |
28 | pub fn parse_fluereflow(packet: pcap::Packet) -> Result<(usize, [u8; 9], FluereRecord), NetError> {
   |        ^^^^^^^^^^^^^^^^
   |
   = help: you could split it up into multiple smaller functions
   = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#cognitive_complexity
   = note: requested on the command line with `-D clippy::cognitive-complexity`

Check failure on line 18 in src/net/packet_pcap.rs

See this annotation in the file changed.

@github-actions github-actions / clippy

used `unwrap()` on a `Result` value

error: used `unwrap()` on a `Result` value
  --> src/net/packet_pcap.rs:18:26
   |
18 |     let mut cap_device = CaptureDevice::new(interface.clone()).unwrap();
   |                          ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
   |
   = note: if this value is an `Err`, it will panic
   = help: consider using `expect()` to provide a better panic message
   = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#unwrap_used

Check failure on line 17 in src/net/packet_pcap.rs

See this annotation in the file changed.

@github-actions github-actions / clippy

used `unwrap()` on a `Result` value

error: used `unwrap()` on a `Result` value
  --> src/net/packet_pcap.rs:17:21
   |
17 |     let interface = find_device(interface_name.as_str()).unwrap();
   |                     ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
   |
   = note: if this value is an `Err`, it will panic
   = help: consider using `expect()` to provide a better panic message
   = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#unwrap_used

Check failure on line 15 in src/net/packet_pcap.rs

See this annotation in the file changed.

@github-actions github-actions / clippy

used `unwrap()` on an `Option` value

error: used `unwrap()` on an `Option` value
  --> src/net/packet_pcap.rs:15:26
   |
15 |     let _sleep_windows = args.parameters.sleep_windows.unwrap();
   |                          ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
   |
   = note: if this value is `None`, it will panic
   = help: consider using `expect()` to provide a better panic message
   = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#unwrap_used

Check failure on line 14 in src/net/packet_pcap.rs

See this annotation in the file changed.

@github-actions github-actions / clippy

used `unwrap()` on an `Option` value

error: used `unwrap()` on an `Option` value
  --> src/net/packet_pcap.rs:14:21
   |
14 |     let _interval = args.parameters.interval.unwrap();
   |                     ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
   |
   = note: if this value is `None`, it will panic
   = help: consider using `expect()` to provide a better panic message
   = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#unwrap_used

Check failure on line 13 in src/net/packet_pcap.rs

See this annotation in the file changed.

@github-actions github-actions / clippy

used `unwrap()` on an `Option` value

error: used `unwrap()` on an `Option` value
  --> src/net/packet_pcap.rs:13:20
   |
13 |     let duration = args.parameters.duration.unwrap();
   |                    ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
   |
   = note: if this value is `None`, it will panic
   = help: consider using `expect()` to provide a better panic message
   = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#unwrap_used

Check failure on line 11 in src/net/packet_pcap.rs

See this annotation in the file changed.

@github-actions github-actions / clippy

used `unwrap()` on an `Option` value

error: used `unwrap()` on an `Option` value
  --> src/net/packet_pcap.rs:11:21
   |
11 |     let pcap_file = args.files.pcap.unwrap();
   |                     ^^^^^^^^^^^^^^^^^^^^^^^^
   |
   = note: if this value is `None`, it will panic
   = help: consider using `expect()` to provide a better panic message
   = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#unwrap_used

Check failure on line 264 in src/net/online_fluereflow.rs

See this annotation in the file changed.

@github-actions github-actions / clippy

used `unwrap_err()` on a `Result` value

error: used `unwrap_err()` on a `Result` value
   --> src/net/online_fluereflow.rs:264:40
    |
264 |             error!("Export error: {}", exporter.unwrap_err());
    |                                        ^^^^^^^^^^^^^^^^^^^^^
    |
    = note: if this value is an `Ok`, it will panic
    = help: consider using `expect_err()` to provide a better panic message
    = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#unwrap_used

Check failure on line 253 in src/net/online_fluereflow.rs

See this annotation in the file changed.

@github-actions github-actions / clippy

used `unwrap()` on a `Result` value

error: used `unwrap()` on a `Result` value
   --> src/net/online_fluereflow.rs:253:9
    |
253 |         plugin_manager.process_flow_data(*flow).await.unwrap();
    |         ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
    |
    = note: if this value is an `Err`, it will panic
    = help: consider using `expect()` to provide a better panic message
    = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#unwrap_used

Check failure on line 228 in src/net/online_fluereflow.rs

See this annotation in the file changed.

@github-actions github-actions / clippy

used `unwrap()` on a `Result` value

error: used `unwrap()` on a `Result` value
   --> src/net/online_fluereflow.rs:228:28
    |
228 |                     file = fs::File::create(file_path.as_ref()).unwrap();
    |                            ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
    |
    = note: if this value is an `Err`, it will panic
    = help: consider using `expect()` to provide a better panic message
    = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#unwrap_used