Fix assign_op_pattern warning

https://github.com/Manishearth/rust-clippy/wiki#assign_op_pattern
This commit is contained in:
messense 2017-07-18 22:25:18 +08:00
parent 5a8fd2febc
commit ae40a30243
No known key found for this signature in database
GPG Key ID: BB41A8A2C716CCA9
1 changed files with 8 additions and 8 deletions

View File

@ -1024,42 +1024,42 @@ impl PyObjectProtocol for InPlaceOperations {
#[py::proto]
impl PyNumberProtocol for InPlaceOperations {
fn __iadd__(&mut self, other: u32) -> PyResult<()> {
self.value = self.value + other;
self.value += other;
Ok(())
}
fn __isub__(&mut self, other: u32) -> PyResult<()> {
self.value = self.value - other;
self.value -= other;
Ok(())
}
fn __imul__(&mut self, other: u32) -> PyResult<()> {
self.value = self.value * other;
self.value *= other;
Ok(())
}
fn __ilshift__(&mut self, other: u32) -> PyResult<()> {
self.value = self.value << other;
self.value <<= other;
Ok(())
}
fn __irshift__(&mut self, other: u32) -> PyResult<()> {
self.value = self.value >> other;
self.value >>= other;
Ok(())
}
fn __iand__(&mut self, other: u32) -> PyResult<()> {
self.value = self.value & other;
self.value &= other;
Ok(())
}
fn __ixor__(&mut self, other: u32) -> PyResult<()> {
self.value = self.value ^ other;
self.value ^= other;
Ok(())
}
fn __ior__(&mut self, other: u32) -> PyResult<()> {
self.value = self.value | other;
self.value |= other;
Ok(())
}
}