summaryrefslogtreecommitdiff
path: root/rust/src/custombinaryview.rs
diff options
context:
space:
mode:
authorRubens Brandao <git@rubens.io>2024-08-06 10:45:49 -0300
committermason <35282038+emesare@users.noreply.github.com>2024-08-24 11:15:14 -0400
commitde23abd02ab27b6623656ed04e9b62d4dc1361b7 (patch)
tree6f32949a302a258ae7103e04f6896d84011677f2 /rust/src/custombinaryview.rs
parent264b8aa4bf061e84e4363e4accc0bace43ce0aa5 (diff)
Allow the user to modify the BV during initialization
Diffstat (limited to 'rust/src/custombinaryview.rs')
-rw-r--r--rust/src/custombinaryview.rs4
1 files changed, 2 insertions, 2 deletions
diff --git a/rust/src/custombinaryview.rs b/rust/src/custombinaryview.rs
index 05f1acb8..b930c780 100644
--- a/rust/src/custombinaryview.rs
+++ b/rust/src/custombinaryview.rs
@@ -329,7 +329,7 @@ pub unsafe trait CustomBinaryView: 'static + BinaryViewBase + Sync + Sized {
type Args: Send;
fn new(handle: &BinaryView, args: &Self::Args) -> Result<Self>;
- fn init(&self, args: Self::Args) -> Result<()>;
+ fn init(&mut self, args: Self::Args) -> Result<()>;
}
/// Represents a partially initialized custom `BinaryView` that should be returned to the core
@@ -432,7 +432,7 @@ impl<'a, T: CustomBinaryViewType> CustomViewBuilder<'a, T> {
match context
.view
- .assume_init_ref()
+ .assume_init_mut()
.init(ptr::read(&context.args))
{
Ok(_) => true,