You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
537: Don't use a mask when not needed r=Emilgardis a=thibautvdv
When the mask has the same size as the parent register of a field, then
a mask is not required. This removes the clippy warnings/errors where
for example an operation of inverting a mask results in zero
```
error: this operation will always return zero. This is likely not the intended outcome
|
61 | self.w.bits = (self.w.bits & !0xffff_ffff) | (value as u32 & 0xffff_ffff);
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
```
or when the operation of using a mask is ineffective.
```
warning: the operation is ineffective. Consider reducing it to `value as u32`
|
61 | self.w.bits = (self.w.bits & !0xffff_ffff) | (value as u32 & 0xffff_ffff);
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
```
Co-authored-by: Thibaut Vandervelden <thvdveld@vub.be>
0 commit comments