summaryrefslogtreecommitdiff
path: root/rust/src
diff options
context:
space:
mode:
authorMason Reed <mason@vector35.com>2025-07-02 23:10:11 -0400
committerMason Reed <mason@vector35.com>2025-07-02 23:10:11 -0400
commit48e705fd2ea86f985483312fa8ac98d5c5300466 (patch)
tree3124bf6ca5d227521541f06693bd180a6fe52857 /rust/src
parent3e9f4866914f882bc92aaf99dd1f4d17a8168afb (diff)
[Rust] Misc cleanup
Diffstat (limited to 'rust/src')
-rw-r--r--rust/src/function.rs3
-rw-r--r--rust/src/tags.rs6
2 files changed, 4 insertions, 5 deletions
diff --git a/rust/src/function.rs b/rust/src/function.rs
index 55a609cf..c61e4291 100644
--- a/rust/src/function.rs
+++ b/rust/src/function.rs
@@ -1146,8 +1146,7 @@ impl Function {
// Create tag
let tag = Tag::new(tag_type, data);
- let binaryview = unsafe { BinaryView::ref_from_raw(BNGetFunctionData(self.handle)) };
- unsafe { BNAddTag(binaryview.handle, tag.handle, user) };
+ unsafe { BNAddTag(self.view().handle, tag.handle, user) };
unsafe {
match (user, addr) {
diff --git a/rust/src/tags.rs b/rust/src/tags.rs
index a8c4d5d4..4817f596 100644
--- a/rust/src/tags.rs
+++ b/rust/src/tags.rs
@@ -138,6 +138,7 @@ impl TagType {
let tag_type = unsafe { Self::ref_from_raw(BNCreateTagType(view.handle)) };
tag_type.set_name(name);
tag_type.set_icon(icon);
+ tag_type.set_type(TagTypeType::UserTagType);
tag_type
}
@@ -179,10 +180,9 @@ impl TagType {
unsafe { BNTagTypeGetType(self.handle) }
}
- pub fn set_type(&self, t: &str) {
- let t = t.to_cstr();
+ pub fn set_type(&self, ty: TagTypeType) {
unsafe {
- BNTagTypeSetName(self.handle, t.as_ptr());
+ BNTagTypeSetType(self.handle, ty);
}
}