diff options
author | Brian Cully <bjc@kublai.com> | 2019-09-09 21:19:01 -0400 |
---|---|---|
committer | Brian Cully <bjc@kublai.com> | 2019-09-09 21:19:01 -0400 |
commit | 58a268850f34b660c9c71a3442b7cc70d21944da (patch) | |
tree | eb730c6f5590a1825aae0651c5bd0f8835806f18 /src/pipe/addr.rs | |
parent | 27177f3d9b82c51a1131784123e9492f6d852c45 (diff) | |
download | atsamd-usb-host-58a268850f34b660c9c71a3442b7cc70d21944da.tar.gz atsamd-usb-host-58a268850f34b660c9c71a3442b7cc70d21944da.zip |
Clippy.
Diffstat (limited to 'src/pipe/addr.rs')
-rw-r--r-- | src/pipe/addr.rs | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/src/pipe/addr.rs b/src/pipe/addr.rs index b3548cf..d71ee2d 100644 --- a/src/pipe/addr.rs +++ b/src/pipe/addr.rs @@ -17,7 +17,7 @@ pub struct W { } impl Addr { - pub fn read(&self) -> R { + pub fn read(self) -> R { R { bits: self.0 } } @@ -89,7 +89,7 @@ impl<'a> AddrW<'a> { pub unsafe fn bits(self, v: u32) -> &'a mut W { // Address must be 32-bit aligned. cf ยง32.8.7.2 of SAMD21 data // sheet. - assert!((v & 0x3) == 0); + debug_assert!(v.trailing_zeros() >= 2); self.w.bits = v; self.w } |