From: Modupe Falodun Date: Sun, 31 Oct 2021 16:31:52 +0000 (+0100) Subject: rust: fix inherent to string X-Git-Tag: suricata-7.0.0-beta1~1275 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=74c39500c36136697b156eeb3238e647a151e374;p=thirdparty%2Fsuricata.git rust: fix inherent to string Bug: OISF#4618 --- diff --git a/rust/src/lib.rs b/rust/src/lib.rs index a7399d9f51..e182074ab7 100644 --- a/rust/src/lib.rs +++ b/rust/src/lib.rs @@ -62,7 +62,6 @@ #![allow(clippy::branches_sharing_code)] #![allow(clippy::while_let_loop)] #![allow(clippy::redundant_pattern_matching)] -#![allow(clippy::inherent_to_string)] #![allow(clippy::field_reassign_with_default)] #![allow(clippy::collapsible_match)] diff --git a/rust/src/smb/ntlmssp_records.rs b/rust/src/smb/ntlmssp_records.rs index e0fca25c8c..879ad13b0f 100644 --- a/rust/src/smb/ntlmssp_records.rs +++ b/rust/src/smb/ntlmssp_records.rs @@ -15,6 +15,7 @@ * 02110-1301, USA. */ +use std::fmt; use nom::IResult; use nom::combinator::rest; use nom::number::streaming::{le_u8, le_u16, le_u32}; @@ -27,9 +28,9 @@ pub struct NTLMSSPVersion { pub ver_ntlm_rev: u8, } -impl NTLMSSPVersion { - pub fn to_string(&self) -> String { - format!("{}.{} build {} rev {}", +impl fmt::Display for NTLMSSPVersion { + fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result { + write!(f, "{}.{} build {} rev {}", self.ver_major, self.ver_minor, self.ver_build, self.ver_ntlm_rev) }