summaryrefslogtreecommitdiff
path: root/rust/src/types.rs
diff options
context:
space:
mode:
authorMason Reed <mason@vector35.com>2025-05-04 20:43:32 -0400
committerMason Reed <35282038+emesare@users.noreply.github.com>2025-05-12 17:45:24 -0400
commitf32f083c81a5034530ac33ad2bc460dd234186a5 (patch)
tree02e5799b595322b3a6967977ac69257eb023e882 /rust/src/types.rs
parente12dac56c123bcf39708cb381497753250eb1887 (diff)
[Rust] More cleanup regarding `BnString`
- Removed `to_string` shortcut from `BnString`. - Misc formatting
Diffstat (limited to 'rust/src/types.rs')
-rw-r--r--rust/src/types.rs10
1 files changed, 5 insertions, 5 deletions
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<BnString>) -> Option<Ref<Type>> {
+ fn target_helper(&self, bv: &BinaryView, visited: &mut HashSet<String>) -> Option<Ref<Type>> {
let ty = bv.type_by_id(self.id())?;
match ty.type_class() {
TypeClass::NamedTypeReferenceClass => {