Skip to content

Commit dd80f42

Browse files
committed
better
1 parent fb8ece5 commit dd80f42

File tree

1 file changed

+6
-6
lines changed

1 file changed

+6
-6
lines changed

src/sys/flags.rs

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -688,7 +688,7 @@ impl NodeFlags {
688688
///
689689
/// This function is called `mark_sample` to not conflict
690690
/// with [`NodeFlags::is_sample`], which predates it.
691-
fn mark_sample(self) -> Self {
691+
pub fn mark_sample(self) -> Self {
692692
Self(self.0 | Self::IS_SAMPLE)
693693
}
694694

@@ -710,15 +710,15 @@ impl NodeFlags {
710710
}
711711

712712
pub fn contains(&self, bit: tsk_flags_t) -> bool {
713-
(self.0 & bit) != 0
713+
bit == 0 || (self.0 & bit) != 0
714714
}
715715

716-
pub fn toggle(self, bit: tsk_flags_t) -> Self {
717-
Self(self.0 ^ bit)
716+
pub fn toggle(&mut self, bit: tsk_flags_t) {
717+
self.0 ^= bit
718718
}
719719

720-
pub fn remove(self, bit: tsk_flags_t) -> Self {
721-
Self(self.0 & !bit)
720+
pub fn remove(&mut self, bit: tsk_flags_t) {
721+
self.0 &= !bit
722722
}
723723
}
724724

0 commit comments

Comments
 (0)