From 193dea95daedde471e6f1fbcbeaf1932c6fbd50c Mon Sep 17 00:00:00 2001 From: Rubens Brandao Date: Sat, 6 Apr 2024 16:32:00 -0300 Subject: replace BStr with str --- rust/src/symbol.rs | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) (limited to 'rust/src/symbol.rs') diff --git a/rust/src/symbol.rs b/rust/src/symbol.rs index 25801eee..cf4c3b10 100644 --- a/rust/src/symbol.rs +++ b/rust/src/symbol.rs @@ -14,6 +14,7 @@ //! Interfaces for the various kinds of symbols in a binary. +use std::ffi::CStr; use std::fmt; use std::hash::{Hash, Hasher}; use std::ptr; @@ -252,17 +253,17 @@ impl Symbol { } } - pub fn short_name(&self) -> BnString { + pub fn short_name(&self) -> &str { unsafe { let name = BNGetSymbolShortName(self.handle); - BnString::from_raw(name) + CStr::from_ptr(name).to_str().unwrap() } } - pub fn raw_name(&self) -> BnString { + pub fn raw_name(&self) -> &str { unsafe { let name = BNGetSymbolRawName(self.handle); - BnString::from_raw(name) + CStr::from_ptr(name).to_str().unwrap() } } -- cgit v1.3.1