From 58a268850f34b660c9c71a3442b7cc70d21944da Mon Sep 17 00:00:00 2001 From: Brian Cully Date: Mon, 9 Sep 2019 21:19:01 -0400 Subject: Clippy. --- src/pipe/addr.rs | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'src/pipe/addr.rs') 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 } -- cgit v1.2.3