rust: fix cargo clippy --all-features

pull/8157/head
Philippe Antoine 3 years ago committed by Victor Julien
parent bc287018e5
commit 286bd2a7ed

@ -79,11 +79,7 @@ pub extern "C" fn rs_dns_opcode_match(
return 0;
};
if match_opcode(detect, header_flags) {
1
} else {
0
}
match_opcode(detect, header_flags).into()
}
fn match_opcode(detect: &DetectDnsOpcode, flags: u16) -> bool {

@ -69,9 +69,6 @@ impl Default for FileContainer {
}
impl FileContainer {
pub fn default() -> FileContainer {
FileContainer { head:ptr::null_mut(), tail:ptr::null_mut() }
}
pub fn free(&mut self) {
SCLogDebug!("freeing self");
if let Some(c) = unsafe {SC} {

@ -65,7 +65,7 @@ impl Frame {
stream_slice,
offset as u32,
frame_len,
if stream_slice.flags() & STREAM_TOSERVER != 0 { 0 } else { 1 },
(stream_slice.flags() & STREAM_TOSERVER == 0).into(),
frame_type,
)
};

@ -87,8 +87,8 @@ struct SmbFlags {
fn parse_smb2_flags(i: &[u8]) -> IResult<&[u8], SmbFlags> {
let (i, val) = le_u32(i)?;
let direction = if val & SMB2_FLAGS_SERVER_TO_REDIR != 0 { 1 } else { 0 };
let async_command = if val & SMB2_FLAGS_ASYNC_COMMAND != 0 { 1 } else { 0 };
let direction = u8::from(val & SMB2_FLAGS_SERVER_TO_REDIR != 0);
let async_command = u8::from(val & SMB2_FLAGS_ASYNC_COMMAND != 0);
Ok((i, SmbFlags {
direction,
async_command,

Loading…
Cancel
Save