diff options
| author | Mason Reed <mason@vector35.com> | 2025-01-25 20:10:36 -0500 |
|---|---|---|
| committer | Mason Reed <mason@vector35.com> | 2025-01-25 20:10:36 -0500 |
| commit | 174879116fd1ed6805137949e763223acd79784c (patch) | |
| tree | b390d86e7454a711d0a2ee0f2538d9af35b3f5d1 /rust/src | |
| parent | 567988ad3cd7da3fac9298e24f733b61d37c1e13 (diff) | |
Fix incorrect immutable borrow for EnumerationBuilder
Diffstat (limited to 'rust/src')
| -rw-r--r-- | rust/src/types.rs | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/rust/src/types.rs b/rust/src/types.rs index bd184b18..701fc85a 100644 --- a/rust/src/types.rs +++ b/rust/src/types.rs @@ -1217,7 +1217,7 @@ impl EnumerationBuilder { unsafe { Enumeration::ref_from_raw(BNFinalizeEnumerationBuilder(self.handle)) } } - pub fn append<S: BnStrCompatible>(&self, name: S) -> &Self { + pub fn append<S: BnStrCompatible>(&mut self, name: S) -> &Self { let name = name.into_bytes_with_nul(); unsafe { BNAddEnumerationBuilderMember(self.handle, name.as_ref().as_ptr() as _); @@ -1225,7 +1225,7 @@ impl EnumerationBuilder { self } - pub fn insert<S: BnStrCompatible>(&self, name: S, value: u64) -> &Self { + pub fn insert<S: BnStrCompatible>(&mut self, name: S, value: u64) -> &Self { let name = name.into_bytes_with_nul(); unsafe { BNAddEnumerationBuilderMemberWithValue(self.handle, name.as_ref().as_ptr() as _, value); @@ -1233,7 +1233,7 @@ impl EnumerationBuilder { self } - pub fn replace<S: BnStrCompatible>(&self, id: usize, name: S, value: u64) -> &Self { + pub fn replace<S: BnStrCompatible>(&mut self, id: usize, name: S, value: u64) -> &Self { let name = name.into_bytes_with_nul(); unsafe { BNReplaceEnumerationBuilderMember(self.handle, id, name.as_ref().as_ptr() as _, value); @@ -1241,7 +1241,7 @@ impl EnumerationBuilder { self } - pub fn remove(&self, id: usize) -> &Self { + pub fn remove(&mut self, id: usize) -> &Self { unsafe { BNRemoveEnumerationBuilderMember(self.handle, id); } |
