summaryrefslogtreecommitdiff
path: root/rust/src/disassembly.rs
diff options
context:
space:
mode:
authorKyleMiles <krm504@nyu.edu>2023-01-05 17:29:14 -0500
committerKyleMiles <krm504@nyu.edu>2023-01-06 16:29:58 -0500
commita154e45cce79b0c2264c1e1cd37a3d1bf5bc6154 (patch)
tree11f436b720edfdf37819e9e83e7131d220687074 /rust/src/disassembly.rs
parent52edc39a7081fd6662e14fbcd473adabbbc36c7a (diff)
Rust API: Lots and lots of clippy changes
Diffstat (limited to 'rust/src/disassembly.rs')
-rw-r--r--rust/src/disassembly.rs8
1 files changed, 2 insertions, 6 deletions
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(())