rust/dcerpc: fix single_match clippy warning

warning: you seem to be trying to use `match` for destructuring a single pattern. Consider using `if let`
  --> src/dcerpc/log.rs:36:33
   |
36 |               DCERPC_TYPE_BIND => match &state.bind {
   |  _________________________________^
37 | |                 Some(bind) => {
38 | |                     jsb.open_array("interfaces")?;
39 | |                     for uuid in &bind.uuid_list {
...  |
51 | |                 None => {}
52 | |             },
   | |_____________^
   |
   = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#single_match
   = note: `#[warn(clippy::single_match)]` on by default
pull/11755/head
Philippe Antoine 1 month ago committed by Victor Julien
parent 89d229c76f
commit 2a984e3b13

@ -33,8 +33,7 @@ fn log_dcerpc_header_tcp(
jsb.set_uint("stub_data_size", tx.stub_data_buffer_ts.len() as u64)?;
jsb.close()?;
}
DCERPC_TYPE_BIND => match &state.bind {
Some(bind) => {
DCERPC_TYPE_BIND => if let Some(bind) = &state.bind {
jsb.open_array("interfaces")?;
for uuid in &bind.uuid_list {
jsb.start_object()?;
@ -47,8 +46,6 @@ fn log_dcerpc_header_tcp(
jsb.close()?;
}
jsb.close()?;
}
None => {}
},
_ => {}
}

Loading…
Cancel
Save