From 73c8554b8d5d460ed8fc331e787b9b272882e9b1 Mon Sep 17 00:00:00 2001 From: Joe Rozner Date: Sun, 10 May 2026 17:17:17 -0700 Subject: [Rust] Fix `load_with_options_and_progress` when options is `None` A similar fix was applied for `load_view_with_options` inhttps://github.com/Vector35/binaryninja-api/commit/ff58143ff7794d7251f9182294dd25bd4cbe15eb but was not applied here. This allows `None` to be correctly passed for options. --- rust/src/lib.rs | 8 +------- 1 file changed, 1 insertion(+), 7 deletions(-) diff --git a/rust/src/lib.rs b/rust/src/lib.rs index f420fa30..62ee776e 100644 --- a/rust/src/lib.rs +++ b/rust/src/lib.rs @@ -94,8 +94,6 @@ use crate::progress::{NoProgressCallback, ProgressCallback}; use crate::string::raw_to_string; use binary_view::BinaryView; use binaryninjacore_sys::*; -use metadata::Metadata; -use metadata::MetadataType; use rc::Ref; use std::cmp; use std::collections::HashMap; @@ -199,11 +197,7 @@ where .to_bytes_with_nul() .to_vec() } else { - Metadata::new_of_type(MetadataType::KeyValueDataType) - .get_json_string() - .ok()? - .as_ref() - .to_vec() + "{}".to_cstr().to_bytes_with_nul().to_vec() }; let handle = unsafe { BNLoadFilename( -- cgit v1.3.1