diff options
| author | Rubens Brandao <git@rubens.io> | 2024-07-18 12:23:27 -0300 |
|---|---|---|
| committer | mason <35282038+emesare@users.noreply.github.com> | 2024-07-29 11:20:20 +0000 |
| commit | 8778721d7ff62a61d83dec2ba1d5ff139162eef7 (patch) | |
| tree | 5a3639645c23a78f0b410d6ccbe321af578b3c0d /rust/src | |
| parent | 9d73e9d7930f20339f9582e55544f0af7aeadd23 (diff) | |
fix rust Database::file
Diffstat (limited to 'rust/src')
| -rw-r--r-- | rust/src/database.rs | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/rust/src/database.rs b/rust/src/database.rs index 09cdde54..3274c9c0 100644 --- a/rust/src/database.rs +++ b/rust/src/database.rs @@ -8,7 +8,7 @@ use crate::binaryview::BinaryView; use crate::databuffer::DataBuffer; use crate::disassembly::InstructionTextToken; use crate::filemetadata::FileMetadata; -use crate::rc::{Array, CoreArrayProvider, CoreArrayProviderInner}; +use crate::rc::{Array, CoreArrayProvider, CoreArrayProviderInner, Ref}; use crate::string::{BnStrCompatible, BnString}; #[repr(transparent)] @@ -180,10 +180,10 @@ impl Database { } /// Get the owning FileMetadata - pub fn file(&self) -> FileMetadata { + pub fn file(&self) -> Ref<FileMetadata> { let result = unsafe { BNGetDatabaseFile(self.as_raw()) }; assert!(!result.is_null()); - FileMetadata::from_raw(result) + unsafe { Ref::new(FileMetadata::from_raw(result)) } } /// Get the backing analysis cache kvs |
