Merge rust-bitcoin/rust-bitcoin#2845: fix ServiceFlags::remove
0949be931a
fix ServiceFlags::remove (Antoni Spaanderman) Pull request description: Contrary to the documentation and the method name, this function does an XOR operation, if there are no flags in `self`, flags from `other` are added. What should happen to the core::ops::BitXor{,Assign} implementations? I did not touch them because it would break current API usage and would require a minor version bump (on 0.x.y versions). ACKs for top commit: Kixunil: ACK0949be931a
apoelstra: ACK0949be931a
looks good. I think it is fine to retain a BitXor impl on a flag type, even if it is questionably useful Tree-SHA512: d73853e5fe5e3776ef5cfb54c1ae2f9151c17c51861759b096eae339d4c9a544a9a32f5cc23e76f79827a40425a8a0823e2b989ed9ab98b8373d2b8d94418e8e
This commit is contained in:
commit
4543309518
|
@ -110,7 +110,7 @@ impl ServiceFlags {
|
|||
///
|
||||
/// Returns itself.
|
||||
pub fn remove(&mut self, other: ServiceFlags) -> ServiceFlags {
|
||||
self.0 ^= other.0;
|
||||
self.0 &= !other.0;
|
||||
*self
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in New Issue