diff options
| -rw-r--r-- | rust/src/binary_view.rs | 6 | ||||
| -rw-r--r-- | rust/src/section.rs | 8 |
2 files changed, 7 insertions, 7 deletions
diff --git a/rust/src/binary_view.rs b/rust/src/binary_view.rs index 35383f0b..04a60a0d 100644 --- a/rust/src/binary_view.rs +++ b/rust/src/binary_view.rs @@ -871,7 +871,7 @@ pub trait BinaryViewExt: BinaryViewBase { section.create(self.as_ref()); } - fn remove_auto_section(&self, name: &str) { + fn remove_auto_section(&self, name: impl IntoCStr) { let raw_name = name.to_cstr(); let raw_name_ptr = raw_name.as_ptr(); unsafe { @@ -879,7 +879,7 @@ pub trait BinaryViewExt: BinaryViewBase { } } - fn remove_user_section(&self, name: &str) { + fn remove_user_section(&self, name: impl IntoCStr) { let raw_name = name.to_cstr(); let raw_name_ptr = raw_name.as_ptr(); unsafe { @@ -887,7 +887,7 @@ pub trait BinaryViewExt: BinaryViewBase { } } - fn section_by_name(&self, name: &str) -> Option<Ref<Section>> { + fn section_by_name(&self, name: impl IntoCStr) -> Option<Ref<Section>> { unsafe { let raw_name = name.to_cstr(); let name_ptr = raw_name.as_ptr(); diff --git a/rust/src/section.rs b/rust/src/section.rs index a86c54e2..77e40232 100644 --- a/rust/src/section.rs +++ b/rust/src/section.rs @@ -121,12 +121,12 @@ impl Section { unsafe { BNSectionGetSemantics(self.handle).into() } } - pub fn linked_section(&self) -> String { - unsafe { BnString::into_string(BNSectionGetLinkedSection(self.handle)) } + pub fn linked_section(&self) -> BnString { + unsafe { BnString::from_raw(BNSectionGetLinkedSection(self.handle)) } } - pub fn info_section(&self) -> String { - unsafe { BnString::into_string(BNSectionGetInfoSection(self.handle)) } + pub fn info_section(&self) -> BnString { + unsafe { BnString::from_raw(BNSectionGetInfoSection(self.handle)) } } pub fn info_data(&self) -> u64 { |
