Skip to content

Commit 702a130

Browse files
committed
Add #[inline(always)] to three generated methods.
All three appear to be trivial wrappers, making the inline useful
1 parent 3767036 commit 702a130

File tree

1 file changed

+3
-0
lines changed

1 file changed

+3
-0
lines changed

src/generate/register.rs

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -70,6 +70,7 @@ pub fn render(
7070
}
7171

7272
impl From<crate::R<#name_uc_spec>> for R {
73+
#[inline(always)]
7374
fn from(reader: crate::R<#name_uc_spec>) -> Self {
7475
R(reader)
7576
}
@@ -101,6 +102,7 @@ pub fn render(
101102
}
102103

103104
impl From<crate::W<#name_uc_spec>> for W {
105+
#[inline(always)]
104106
fn from(writer: crate::W<#name_uc_spec>) -> Self {
105107
W(writer)
106108
}
@@ -161,6 +163,7 @@ pub fn render(
161163

162164
mod_items.extend(quote! {
163165
#[doc = "Writes raw bits to the register."]
166+
#[inline(always)]
164167
pub unsafe fn bits(&mut self, bits: #rty) -> &mut Self {
165168
self.0.bits(bits);
166169
self

0 commit comments

Comments
 (0)