rust: fix clippy warnings

pull/9233/head
Shivani Bhardwaj 2 years ago committed by Victor Julien
parent 0068b81269
commit d4e674b390

@ -723,7 +723,7 @@ impl DCERPCState {
Ok((leftover_bytes, mut back)) => {
if let Some(ref mut bind) = self.bind {
for (uuid_internal_id, r) in back.ctxitems.iter().enumerate() {
for mut uuid in bind.uuid_list.iter_mut() {
for uuid in bind.uuid_list.iter_mut() {
if uuid.internal_id == uuid_internal_id as u16 {
uuid.result = r.ack_result;
if uuid.result != 0 {

@ -969,7 +969,7 @@ impl HTTP2State {
//borrow checker forbids to reuse directly tx
let index = self.find_tx_index(sid);
if index > 0 {
let mut tx_same = &mut self.transactions[index - 1];
let tx_same = &mut self.transactions[index - 1];
if dir == Direction::ToServer {
tx_same.ft_tc.tx_id = tx_same.tx_id - 1;
} else {

@ -96,7 +96,7 @@ impl Default for Ikev2Container {
}
pub fn handle_ikev2(
mut state: &mut IKEState, current: &[u8], isakmp_header: IsakmpHeader, direction: Direction,
state: &mut IKEState, current: &[u8], isakmp_header: IsakmpHeader, direction: Direction,
) -> AppLayerResult {
let hdr = IkeV2Header {
init_spi: isakmp_header.init_spi,

@ -116,10 +116,7 @@ pub enum DetectKrb5TicketEncryptionData {
pub fn detect_parse_encryption_weak(i: &str) -> IResult<&str, DetectKrb5TicketEncryptionData> {
let (i, neg) = opt(char('!'))(i)?;
let (i, _) = tag("weak")(i)?;
let value = match neg {
Some(_) => false,
_ => true,
};
let value = neg.is_none();
return Ok((i, DetectKrb5TicketEncryptionData::WEAK(value)));
}

@ -1951,7 +1951,7 @@ pub unsafe extern "C" fn rs_smb_parse_request_tcp(flow: *const Flow,
)
-> AppLayerResult
{
let mut state = cast_pointer!(state, SMBState);
let state = cast_pointer!(state, SMBState);
let flow = cast_pointer!(flow, Flow);
if stream_slice.is_gap() {
@ -1988,7 +1988,7 @@ pub unsafe extern "C" fn rs_smb_parse_response_tcp(flow: *const Flow,
)
-> AppLayerResult
{
let mut state = cast_pointer!(state, SMBState);
let state = cast_pointer!(state, SMBState);
let flow = cast_pointer!(flow, Flow);
if stream_slice.is_gap() {

@ -110,7 +110,7 @@ impl SSHState {
fn parse_record(
&mut self, mut input: &[u8], resp: bool, pstate: *mut std::os::raw::c_void,
) -> AppLayerResult {
let (mut hdr, ohdr) = if !resp {
let (hdr, ohdr) = if !resp {
(&mut self.transaction.cli_hdr, &self.transaction.srv_hdr)
} else {
(&mut self.transaction.srv_hdr, &self.transaction.cli_hdr)
@ -240,7 +240,7 @@ impl SSHState {
fn parse_banner(
&mut self, input: &[u8], resp: bool, pstate: *mut std::os::raw::c_void,
) -> AppLayerResult {
let mut hdr = if !resp {
let hdr = if !resp {
&mut self.transaction.cli_hdr
} else {
&mut self.transaction.srv_hdr

Loading…
Cancel
Save