summaryrefslogtreecommitdiff
path: root/rust/src/binaryview.rs
diff options
context:
space:
mode:
authorRubens Brandao <git@rubens.io>2024-04-17 07:23:15 -0300
committerRubens Brandao <git@rubens.io>2024-04-17 07:43:43 -0300
commit90040508478f4551eb303a5056026fd59bb0cdc6 (patch)
treeaea3cb4d3c0092505d9fd7b0a93b698806600442 /rust/src/binaryview.rs
parentf408eb32085956f7e29e0f15fd92aa4b72453370 (diff)
allow DataVariable and NameAndType to be transmutable
Diffstat (limited to 'rust/src/binaryview.rs')
-rw-r--r--rust/src/binaryview.rs12
1 files changed, 10 insertions, 2 deletions
diff --git a/rust/src/binaryview.rs b/rust/src/binaryview.rs
index 52d688b8..bcb3f57f 100644
--- a/rust/src/binaryview.rs
+++ b/rust/src/binaryview.rs
@@ -576,14 +576,22 @@ pub trait BinaryViewExt: BinaryViewBase {
fn define_auto_data_var(&self, dv: DataVariable) {
unsafe {
- BNDefineDataVariable(self.as_ref().handle, dv.address, &mut dv.t.into());
+ BNDefineDataVariable(
+ self.as_ref().handle,
+ dv.address(),
+ &mut dv.type_with_confidence().into(),
+ );
}
}
/// You likely would also like to call [`Self::define_user_symbol`] to bind this data variable with a name
fn define_user_data_var(&self, dv: DataVariable) {
unsafe {
- BNDefineUserDataVariable(self.as_ref().handle, dv.address, &mut dv.t.into());
+ BNDefineUserDataVariable(
+ self.as_ref().handle,
+ dv.address(),
+ &mut dv.type_with_confidence().into(),
+ );
}
}