summaryrefslogtreecommitdiff
path: root/rust/src/disassembly.rs
diff options
context:
space:
mode:
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(())