Skip to content

Commit 36a661e

Browse files
wezburrbull
authored andcommitted
inline the union accessors
1 parent 2d578ba commit 36a661e

File tree

1 file changed

+2
-0
lines changed

1 file changed

+2
-0
lines changed

src/generate/peripheral.rs

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -388,13 +388,15 @@ fn register_or_cluster_block(
388388
have_accessors = true;
389389
accessors.append(quote! {
390390
#[doc = #comment]
391+
#[inline(always)]
391392
pub fn #name(&self) -> &#ty {
392393
unsafe {
393394
&*(((self as *const Self) as *const u8).add(#offset) as *const #ty)
394395
}
395396
}
396397

397398
#[doc = #comment]
399+
#[inline(always)]
398400
pub fn #mut_name(&self) -> &mut #ty {
399401
unsafe {
400402
&mut *(((self as *const Self) as *mut u8).add(#offset) as *mut #ty)

0 commit comments

Comments
 (0)