Skip to content

Commit 523a887

Browse files
committed
Declare const ptr() method as const and remove explcit types in casts
Signed-off-by: Daniel Egger <[email protected]>
1 parent fbaaa28 commit 523a887

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

src/generate/peripheral.rs

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -48,14 +48,14 @@ pub fn render(
4848
// Insert the peripheral structure
4949
out.push(quote! {
5050
#[doc = #description]
51-
pub struct #name_pc { _marker: PhantomData<*const ()> }
51+
pub struct #name_pc { _marker: PhantomData<()> }
5252

5353
unsafe impl Send for #name_pc {}
5454

5555
impl #name_pc {
5656
/// Returns a pointer to the register block
57-
pub fn ptr() -> *const #base::RegisterBlock {
58-
#address as *const _
57+
pub const fn ptr() -> *const #base::RegisterBlock {
58+
#address as _
5959
}
6060
}
6161

0 commit comments

Comments
 (0)