Skip to content

Commit b35c577

Browse files
committed
Make register_platform_recognizer return by ref in Rust API
1 parent f4dd846 commit b35c577

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

rust/src/custom_binary_view.rs

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -258,12 +258,12 @@ pub trait BinaryViewTypeExt: BinaryViewTypeBase {
258258
/// Support for this API tentatively requires explicit support in the [`BinaryView`] implementation.
259259
fn register_platform_recognizer<R>(&self, id: u32, endian: Endianness, recognizer: R)
260260
where
261-
R: 'static + Fn(&BinaryView, &Metadata) -> Option<Platform> + Send + Sync,
261+
R: 'static + Fn(&BinaryView, &Metadata) -> Option<Ref<Platform>> + Send + Sync,
262262
{
263263
#[repr(C)]
264264
struct PlatformRecognizerHandlerContext<R>
265265
where
266-
R: 'static + Fn(&BinaryView, &Metadata) -> Option<Platform> + Send + Sync,
266+
R: 'static + Fn(&BinaryView, &Metadata) -> Option<Ref<Platform>> + Send + Sync,
267267
{
268268
recognizer: R,
269269
}
@@ -274,7 +274,7 @@ pub trait BinaryViewTypeExt: BinaryViewTypeBase {
274274
metadata: *mut BNMetadata,
275275
) -> *mut BNPlatform
276276
where
277-
R: 'static + Fn(&BinaryView, &Metadata) -> Option<Platform> + Send + Sync,
277+
R: 'static + Fn(&BinaryView, &Metadata) -> Option<Ref<Platform>> + Send + Sync,
278278
{
279279
let context = unsafe { &*(ctxt as *mut PlatformRecognizerHandlerContext<R>) };
280280
let bv = unsafe { BinaryView::from_raw(bv).to_owned() };

0 commit comments

Comments
 (0)