From f32f083c81a5034530ac33ad2bc460dd234186a5 Mon Sep 17 00:00:00 2001 From: Mason Reed Date: Sun, 4 May 2025 20:43:32 -0400 Subject: [Rust] More cleanup regarding `BnString` - Removed `to_string` shortcut from `BnString`. - Misc formatting --- rust/src/types.rs | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) (limited to 'rust/src/types.rs') diff --git a/rust/src/types.rs b/rust/src/types.rs index 710a8857..42c1f8d2 100644 --- a/rust/src/types.rs +++ b/rust/src/types.rs @@ -430,7 +430,7 @@ impl TypeBuilder { impl Display for TypeBuilder { fn fmt(&self, f: &mut Formatter<'_>) -> std::fmt::Result { write!(f, "{}", unsafe { - BnString::from_raw(BNGetTypeBuilderString(self.handle, std::ptr::null_mut())) + BnString::into_string(BNGetTypeBuilderString(self.handle, std::ptr::null_mut())) }) } } @@ -944,7 +944,7 @@ impl Type { impl Display for Type { fn fmt(&self, f: &mut Formatter<'_>) -> std::fmt::Result { write!(f, "{}", unsafe { - BnString::from_raw(BNGetTypeString( + BnString::into_string(BNGetTypeString( self.handle, std::ptr::null_mut(), BNTokenEscapingType::NoTokenEscapingType, @@ -1893,15 +1893,15 @@ impl NamedTypeReference { QualifiedName::from_owned_raw(raw_name) } - pub fn id(&self) -> BnString { - unsafe { BnString::from_raw(BNGetTypeReferenceId(self.handle)) } + pub fn id(&self) -> String { + unsafe { BnString::into_string(BNGetTypeReferenceId(self.handle)) } } pub fn class(&self) -> NamedTypeReferenceClass { unsafe { BNGetTypeReferenceClass(self.handle) } } - fn target_helper(&self, bv: &BinaryView, visited: &mut HashSet) -> Option> { + fn target_helper(&self, bv: &BinaryView, visited: &mut HashSet) -> Option> { let ty = bv.type_by_id(self.id())?; match ty.type_class() { TypeClass::NamedTypeReferenceClass => { -- cgit v1.3.1