Skip to content

Commit

Permalink
rust: remove unnecessary lifetimes
Browse files Browse the repository at this point in the history
Fix provided by cargo clipy --fix.

Backport of 7bdbe7e.
  • Loading branch information
jasonish committed Dec 4, 2024
1 parent 60dd1d5 commit 825eadf
Show file tree
Hide file tree
Showing 5 changed files with 5 additions and 5 deletions.
2 changes: 1 addition & 1 deletion rust/src/smb/nbss_records.rs
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ pub struct NbssRecord<'a> {
pub data: &'a[u8],
}

impl<'a> NbssRecord<'a> {
impl NbssRecord<'_> {
pub fn is_valid(&self) -> bool {
let valid = match self.message_type {
NBSS_MSGTYPE_SESSION_MESSAGE |
Expand Down
2 changes: 1 addition & 1 deletion rust/src/smb/smb1_records.rs
Original file line number Diff line number Diff line change
Expand Up @@ -817,7 +817,7 @@ pub struct SmbRecord<'a> {
pub data: &'a[u8],
}

impl<'a> SmbRecord<'a> {
impl SmbRecord<'_> {
pub fn has_unicode_support(&self) -> bool {
self.flags2 & 0x8000_u16 != 0
}
Expand Down
2 changes: 1 addition & 1 deletion rust/src/smb/smb2_records.rs
Original file line number Diff line number Diff line change
Expand Up @@ -65,7 +65,7 @@ pub struct Smb2Record<'a> {
pub data: &'a [u8],
}

impl<'a> Smb2Record<'a> {
impl Smb2Record<'_> {
pub fn is_request(&self) -> bool {
self.direction == 0
}
Expand Down
2 changes: 1 addition & 1 deletion rust/src/snmp/snmp.rs
Original file line number Diff line number Diff line change
Expand Up @@ -82,7 +82,7 @@ pub struct SNMPTransaction<'a> {
tx_data: applayer::AppLayerTxData,
}

impl<'a> Transaction for SNMPTransaction<'a> {
impl Transaction for SNMPTransaction<'_> {
fn id(&self) -> u64 {
self.id
}
Expand Down
2 changes: 1 addition & 1 deletion rust/src/ssh/parser.rs
Original file line number Diff line number Diff line change
Expand Up @@ -167,7 +167,7 @@ pub struct SshPacketKeyExchange<'a> {

const SSH_HASSH_STRING_DELIMITER_SLICE: [u8; 1] = [b';'];

impl<'a> SshPacketKeyExchange<'a> {
impl SshPacketKeyExchange<'_> {
pub fn generate_hassh(
&self, hassh_string: &mut Vec<u8>, hassh: &mut Vec<u8>, to_server: &bool,
) {
Expand Down

0 comments on commit 825eadf

Please sign in to comment.