Skip to content

Commit

Permalink
fix rust Database::file
Browse files Browse the repository at this point in the history
  • Loading branch information
rbran authored and emesare committed Jul 29, 2024
1 parent 9d73e9d commit 8778721
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions rust/src/database.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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)]
Expand Down Expand Up @@ -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
Expand Down

0 comments on commit 8778721

Please sign in to comment.