Skip to content

Commit

Permalink
Fix rust EnumerationBuilder method return types
Browse files Browse the repository at this point in the history
  • Loading branch information
VisualEhrmanntraut authored and emesare committed Jan 27, 2025
1 parent 49ffbcc commit d059f99
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions rust/src/types.rs
Original file line number Diff line number Diff line change
Expand Up @@ -1217,31 +1217,31 @@ impl EnumerationBuilder {
unsafe { Enumeration::ref_from_raw(BNFinalizeEnumerationBuilder(self.handle)) }
}

pub fn append<S: BnStrCompatible>(&mut self, name: S) -> &Self {
pub fn append<S: BnStrCompatible>(&mut self, name: S) -> &mut Self {
let name = name.into_bytes_with_nul();
unsafe {
BNAddEnumerationBuilderMember(self.handle, name.as_ref().as_ptr() as _);
}
self
}

pub fn insert<S: BnStrCompatible>(&mut self, name: S, value: u64) -> &Self {
pub fn insert<S: BnStrCompatible>(&mut self, name: S, value: u64) -> &mut Self {
let name = name.into_bytes_with_nul();
unsafe {
BNAddEnumerationBuilderMemberWithValue(self.handle, name.as_ref().as_ptr() as _, value);
}
self
}

pub fn replace<S: BnStrCompatible>(&mut self, id: usize, name: S, value: u64) -> &Self {
pub fn replace<S: BnStrCompatible>(&mut self, id: usize, name: S, value: u64) -> &mut Self {
let name = name.into_bytes_with_nul();
unsafe {
BNReplaceEnumerationBuilderMember(self.handle, id, name.as_ref().as_ptr() as _, value);
}
self
}

pub fn remove(&mut self, id: usize) -> &Self {
pub fn remove(&mut self, id: usize) -> &mut Self {
unsafe {
BNRemoveEnumerationBuilderMember(self.handle, id);
}
Expand Down

0 comments on commit d059f99

Please sign in to comment.