From a154e45cce79b0c2264c1e1cd37a3d1bf5bc6154 Mon Sep 17 00:00:00 2001 From: KyleMiles Date: Thu, 5 Jan 2023 17:29:14 -0500 Subject: Rust API: Lots and lots of clippy changes --- rust/src/disassembly.rs | 8 ++------ 1 file changed, 2 insertions(+), 6 deletions(-) (limited to 'rust/src/disassembly.rs') diff --git a/rust/src/disassembly.rs b/rust/src/disassembly.rs index 22706f4b..ff33e3dd 100644 --- a/rust/src/disassembly.rs +++ b/rust/src/disassembly.rs @@ -98,7 +98,7 @@ pub enum InstructionTextTokenContents { impl InstructionTextToken { pub(crate) unsafe fn from_raw(raw: &BNInstructionTextToken) -> Self { - Self(raw.clone()) + Self(*raw) } pub fn new(text: BnString, contents: InstructionTextTokenContents) -> Self { @@ -289,11 +289,7 @@ impl DisassemblyTextLine { impl std::fmt::Display for DisassemblyTextLine { fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result { for token in self.tokens() { - let result = write!(f, "{}", token.text()); - - if result.is_err() { - return result; - } + write!(f, "{}", token.text())? } Ok(()) -- cgit v1.3.1