From 02cb0f2ac214eb3e2bc095f5140e3f70cb17dea7 Mon Sep 17 00:00:00 2001 From: Philippe Antoine Date: Fri, 23 Jan 2026 14:51:52 +0100 Subject: [PATCH 1/2] rust: fix unnecessary_unwrap warnings warning: called `unwrap` on `rd.pipe` after checking its variant with `is_some` --> src/smb/smb1.rs:858:28 | 857 | if rd.pipe.is_some() { | -------------------- help: try: `if let Some() = rd.pipe` 858 | let pipe = rd.pipe.unwrap(); | ^^^^^^^^^^^^^^^^ | = help: for further information visit https://rust-lang.github.io/rust-clippy/rust-1.93.0/index.html#unnecessary_unwrap = note: `#[warn(clippy::unnecessary_unwrap)]` on by default --- rust/src/pop3/pop3.rs | 39 ++++++++++++++++++++------------------- rust/src/smb/smb1.rs | 3 +-- 2 files changed, 21 insertions(+), 21 deletions(-) diff --git a/rust/src/pop3/pop3.rs b/rust/src/pop3/pop3.rs index 0e1f28dbf25f..ee2b277ff1a5 100644 --- a/rust/src/pop3/pop3.rs +++ b/rust/src/pop3/pop3.rs @@ -541,26 +541,27 @@ impl POP3State { flow, direction::Direction::ToClient as i32, ); - if response.status == sawp_pop3::Status::OK && tx.request.is_some() { - let command = tx.request.as_ref().unwrap(); - SCLogDebug!("command {:?}", command); - match &command.keyword { - sawp_pop3::Keyword::STLS => { - unsafe { - SCAppLayerRequestProtocolTLSUpgrade(flow); - }; + if response.status == sawp_pop3::Status::OK { + if let Some(command) = &tx.request { + SCLogDebug!("command {:?}", command); + match &command.keyword { + sawp_pop3::Keyword::STLS => { + unsafe { + SCAppLayerRequestProtocolTLSUpgrade(flow); + }; + } + sawp_pop3::Keyword::RETR => { + // Don't hold onto the whole email body + + // TODO: pass off to mime parser + response.data.clear(); + } + sawp_pop3::Keyword::AUTH => { + SCLogDebug!("OK on AUTH, expect base64 blob"); + auth_ok = true; + } + _ => {} } - sawp_pop3::Keyword::RETR => { - // Don't hold onto the whole email body - - // TODO: pass off to mime parser - response.data.clear(); - } - sawp_pop3::Keyword::AUTH => { - SCLogDebug!("OK on AUTH, expect base64 blob"); - auth_ok = true; - } - _ => {} } } tx.response = Some(response); diff --git a/rust/src/smb/smb1.rs b/rust/src/smb/smb1.rs index f3937564e773..0084a4e69eeb 100644 --- a/rust/src/smb/smb1.rs +++ b/rust/src/smb/smb1.rs @@ -854,8 +854,7 @@ pub fn smb1_trans_request_record(state: &mut SMBState, r: &SmbRecord) /* if we have a fid, store it so the response can pick it up */ let mut pipe_dcerpc = false; - if rd.pipe.is_some() { - let pipe = rd.pipe.unwrap(); + if let Some(pipe) = rd.pipe { state.ssn2vec_cache.put(SMBCommonHdr::from1(r, SMBHDR_TYPE_GUID), pipe.fid.to_vec()); From b944e3b1ed20ed3f3719f32c5234f22a6705e04e Mon Sep 17 00:00:00 2001 From: Philippe Antoine Date: Fri, 23 Jan 2026 14:53:17 +0100 Subject: [PATCH 2/2] ci: update rust version to 1.93 --- .github/workflows/builds.yml | 2 +- .github/workflows/rust.yml | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/builds.yml b/.github/workflows/builds.yml index aa8117aa055a..71ec3672337c 100644 --- a/.github/workflows/builds.yml +++ b/.github/workflows/builds.yml @@ -35,7 +35,7 @@ env: # A recent version of stable Rust that is known to pass build, test and other # verification steps in this workflow. This was added because using "stable" # could cause some steps to fail. - RUST_VERSION_KNOWN: "1.91.0" + RUST_VERSION_KNOWN: "1.93.0" jobs: diff --git a/.github/workflows/rust.yml b/.github/workflows/rust.yml index a0f9fa8dc484..0bad98095ae4 100644 --- a/.github/workflows/rust.yml +++ b/.github/workflows/rust.yml @@ -61,7 +61,7 @@ jobs: sudo \ which \ zlib-devel - - run: curl https://sh.rustup.rs -sSf | sh -s -- --default-toolchain 1.91.0 -y + - run: curl https://sh.rustup.rs -sSf | sh -s -- --default-toolchain 1.93.0 -y - run: echo "$HOME/.cargo/bin" >> $GITHUB_PATH - run: cargo install bindgen-cli --version 0.66.0 - uses: actions/checkout@8e8c483db84b4bee98b60c0593521ed34d9990e8