diff --git a/src/generate/register.rs b/src/generate/register.rs index dc1f20ba..f7f94d87 100644 --- a/src/generate/register.rs +++ b/src/generate/register.rs @@ -859,7 +859,8 @@ pub fn fields( #[doc = #array_doc] #inline pub fn #name_snake_case(&self, n: u8) -> #reader_ty { - assert!(n < #dim); + #[allow(clippy::no_effect)] + [(); #dim][n as usize]; #reader_ty::new ( #value ) } }); @@ -1109,7 +1110,8 @@ pub fn fields( #inline #[must_use] pub fn #name_snake_case(&mut self, n: u8) -> #writer_ty<#regspec_ident> { - assert!(n < #dim); + #[allow(clippy::no_effect)] + [(); #dim][n as usize]; #writer_ty::new(self, #offset_calc) } });