Skip to content

Commit

Permalink
replace assert
Browse files Browse the repository at this point in the history
  • Loading branch information
burrbull committed Oct 23, 2023
1 parent f82f7ed commit e7d4788
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions src/generate/register.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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 )
}
});
Expand Down Expand Up @@ -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)
}
});
Expand Down

0 comments on commit e7d4788

Please sign in to comment.