Skip to content

Commit 061edb2

Browse files
rbrannegasora
authored andcommitted
minor fixes
1 parent 7aa21e6 commit 061edb2

File tree

1 file changed

+6
-6
lines changed

1 file changed

+6
-6
lines changed

rust/src/project.rs

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ use std::{ffi, mem};
55
use binaryninjacore_sys::*;
66

77
use crate::metadata::Metadata;
8-
use crate::rc::{Array, CoreArrayProvider, CoreArrayProviderInner};
8+
use crate::rc::{Array, CoreArrayProvider, CoreArrayProviderInner, Ref};
99
use crate::string::{BnStrCompatible, BnString};
1010

1111
#[repr(C)]
@@ -54,7 +54,7 @@ impl Project {
5454
/// Open an existing project
5555
///
5656
/// * `path` - Path to the project directory (.bnpr) or project metadata file (.bnpm)
57-
pub fn open_file<P: BnStrCompatible>(path: P) -> Self {
57+
pub fn open_project<P: BnStrCompatible>(path: P) -> Self {
5858
let path_raw = path.into_bytes_with_nul();
5959
let handle = unsafe { BNOpenProject(path_raw.as_ref().as_ptr() as *const ffi::c_char) };
6060
unsafe { Self::from_raw(NonNull::new(handle).unwrap()) }
@@ -110,23 +110,23 @@ impl Project {
110110
}
111111

112112
/// Set the description of the project
113-
pub fn set_desription<S: BnStrCompatible>(&self, value: S) {
113+
pub fn set_description<S: BnStrCompatible>(&self, value: S) {
114114
let value = value.into_bytes_with_nul();
115115
unsafe {
116116
BNProjectSetDescription(self.as_raw(), value.as_ref().as_ptr() as *const ffi::c_char)
117117
}
118118
}
119119

120120
/// Retrieves metadata stored under a key from the project
121-
pub fn query_metadata<S: BnStrCompatible>(&self, key: S) -> Metadata {
121+
pub fn query_metadata<S: BnStrCompatible>(&self, key: S) -> Ref<Metadata> {
122122
let key = key.into_bytes_with_nul();
123123
let result = unsafe {
124124
BNProjectQueryMetadata(self.as_raw(), key.as_ref().as_ptr() as *const ffi::c_char)
125125
};
126-
unsafe { Metadata::from_raw(result) }
126+
unsafe { Metadata::ref_from_raw(result) }
127127
}
128128

129-
/// Stores metadata within the project
129+
/// Stores metadata within the project,
130130
///
131131
/// * `key` - Key under which to store the Metadata object
132132
/// * `value` - Object to store

0 commit comments

Comments
 (0)