Skip to content

Commit 1202ec4

Browse files
committed
Also always inline set_bit/clear bit
Reduces build size by quite a bit in dev builds but to my surprise also helps in optimised builds using set_bit/clear_bit indirectly via HAL impls. Closes #334 Signed-off-by: Daniel Egger <[email protected]>
1 parent 36c3ec3 commit 1202ec4

File tree

1 file changed

+2
-0
lines changed

1 file changed

+2
-0
lines changed

src/generate/register.rs

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -741,11 +741,13 @@ pub fn fields(
741741
if width == 1 {
742742
proxy_items.push(quote! {
743743
///Sets the field bit
744+
#[inline(always)]
744745
pub #unsafety fn set_bit(self) -> &'a mut W {
745746
self.bit(true)
746747
}
747748

748749
///Clears the field bit
750+
#[inline(always)]
749751
pub #unsafety fn clear_bit(self) -> &'a mut W {
750752
self.bit(false)
751753
}

0 commit comments

Comments
 (0)