rust: drop block-wrapped scrutinees rejected by clippy 1.99

block_scrutinee now warns on a block-wrapped if let scrutinee, since
the block changes when temporaries drop. The file config reads in the
nfs, smb and http2 gettxfiles handlers were wrapped in a pointless
single-expression block; remove it.
pull/16364/head
Victor Julien 4 weeks ago
parent 64bd29d952
commit 1f26c7915c

@ -1759,7 +1759,7 @@ unsafe extern "C" fn http2_getfiles(
tx: *mut std::os::raw::c_void, direction: u8,
) -> AppLayerGetFileState {
let tx = cast_pointer!(tx, HTTP2Transaction);
if let Some(sfcm) = { SURICATA_HTTP2_FILE_CONFIG } {
if let Some(sfcm) = SURICATA_HTTP2_FILE_CONFIG {
if direction & STREAM_TOSERVER != 0 {
return AppLayerGetFileState {
fc: &mut tx.ft_ts.file,

@ -212,7 +212,7 @@ unsafe extern "C" fn nfs_gettxfiles(
if let Some(NFSTransactionTypeData::FILE(ref mut tdf)) = tx.type_data {
let tx_dir: u8 = tdf.direction.into();
if direction & tx_dir != 0 {
if let Some(sfcm) = { SURICATA_NFS_FILE_CONFIG } {
if let Some(sfcm) = SURICATA_NFS_FILE_CONFIG {
return AppLayerGetFileState {
fc: &mut tdf.file_tracker.file,
cfg: sfcm.files_sbcfg,

@ -342,7 +342,7 @@ pub(super) unsafe extern "C" fn smb_gettxfiles(
if let Some(SMBTransactionTypeData::FILE(ref mut tdf)) = tx.type_data {
let tx_dir: u8 = tdf.direction.into();
if direction & tx_dir != 0 {
if let Some(sfcm) = { SURICATA_SMB_FILE_CONFIG } {
if let Some(sfcm) = SURICATA_SMB_FILE_CONFIG {
return AppLayerGetFileState {
fc: &mut tdf.file_tracker.file,
cfg: sfcm.files_sbcfg,

Loading…
Cancel
Save