From 334ea436bf65edcc9456f4850f6bb9b5497b7be0 Mon Sep 17 00:00:00 2001 From: Mason Reed Date: Tue, 11 Feb 2025 14:30:58 -0500 Subject: [PATCH] Rust API misc formatting --- plugins/dwarf/shared/src/lib.rs | 4 +++- rust/src/disassembly.rs | 4 +++- rust/src/flowgraph.rs | 2 +- 3 files changed, 7 insertions(+), 3 deletions(-) diff --git a/plugins/dwarf/shared/src/lib.rs b/plugins/dwarf/shared/src/lib.rs index ea8542380..e769b44ea 100644 --- a/plugins/dwarf/shared/src/lib.rs +++ b/plugins/dwarf/shared/src/lib.rs @@ -179,7 +179,9 @@ pub fn create_section_reader<'a, Endian: 'a + Endianity>( } } // Truncate Mach-O section names to 16 bytes - else if let Some(section) = view.section_by_name("__".to_string() + §ion_name[1..section_name.len().min(15)]) { + else if let Some(section) = + view.section_by_name("__".to_string() + §ion_name[1..section_name.len().min(15)]) + { Ok(EndianRcSlice::new( Rc::from(view.read_vec(section.start(), section.len()).as_slice()), endian, diff --git a/rust/src/disassembly.rs b/rust/src/disassembly.rs index 290e48d28..94f76f968 100644 --- a/rust/src/disassembly.rs +++ b/rust/src/disassembly.rs @@ -839,7 +839,9 @@ impl From for BNInstructionTextTokenType { } InstructionTextTokenKind::Opcode => BNInstructionTextTokenType::OpcodeToken, InstructionTextTokenKind::String { .. } => BNInstructionTextTokenType::StringToken, - InstructionTextTokenKind::StringContent { .. } => BNInstructionTextTokenType::StringToken, + InstructionTextTokenKind::StringContent { .. } => { + BNInstructionTextTokenType::StringToken + } InstructionTextTokenKind::CharacterConstant => { BNInstructionTextTokenType::CharacterConstantToken } diff --git a/rust/src/flowgraph.rs b/rust/src/flowgraph.rs index 69e97bb9a..8c483958d 100644 --- a/rust/src/flowgraph.rs +++ b/rust/src/flowgraph.rs @@ -65,7 +65,7 @@ impl FlowGraph { let arch = CoreArchitecture::from_raw(arch_ptr); BNFreeFunction(func_ptr); Ok(RegularLowLevelILFunction::ref_from_raw(arch, llil_ptr)) - }, + } true => Err(()), } }