Skip to content

Commit

Permalink
Merge pull request #23 from eZioPan/remove-clippy-warning
Browse files Browse the repository at this point in the history
remove clippy warning from generated files.
  • Loading branch information
Dirbaio authored Feb 15, 2024
2 parents 9696b86 + c93c8e4 commit 87298cb
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 2 deletions.
1 change: 1 addition & 0 deletions src/generate/common.rs
Original file line number Diff line number Diff line change
Expand Up @@ -37,6 +37,7 @@ unsafe impl<T: Copy, A: Access> Send for Reg<T, A> {}
unsafe impl<T: Copy, A: Access> Sync for Reg<T, A> {}

impl<T: Copy, A: Access> Reg<T, A> {
#[allow(clippy::missing_safety_doc)]
#[inline(always)]
pub const unsafe fn from_ptr(ptr: *mut T) -> Self {
Self {
Expand Down
4 changes: 2 additions & 2 deletions src/generate/device.rs
Original file line number Diff line number Diff line change
Expand Up @@ -57,12 +57,12 @@ pub fn render(_opts: &super::Options, ir: &IR, d: &Device, path: &str) -> Result

peripherals.extend(quote! {
#doc
pub const #name: #path = unsafe { #path::from_ptr(#address as usize as _) };
pub const #name: #path = unsafe { #path::from_ptr(#address as _) };
});
} else {
peripherals.extend(quote! {
#doc
pub const #name: *mut () = #address as usize as _;
pub const #name: *mut () = #address as _;
});
}
}
Expand Down

0 comments on commit 87298cb

Please sign in to comment.