Skip to content

Commit 02226ad

Browse files
committed
Always inline for accessor newtype deref(_mut)
1 parent a4bfbae commit 02226ad

File tree

1 file changed

+6
-0
lines changed

1 file changed

+6
-0
lines changed

src/generate/register.rs

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -62,6 +62,7 @@ pub fn render(
6262
impl core::ops::Deref for R {
6363
type Target = crate::R<#name_uc_spec>;
6464

65+
#[inline(always)]
6566
fn deref(&self) -> &Self::Target {
6667
&self.0
6768
}
@@ -85,12 +86,14 @@ pub fn render(
8586
impl core::ops::Deref for W {
8687
type Target = crate::W<#name_uc_spec>;
8788

89+
#[inline(always)]
8890
fn deref(&self) -> &Self::Target {
8991
&self.0
9092
}
9193
}
9294

9395
impl core::ops::DerefMut for W {
96+
#[inline(always)]
9497
fn deref_mut(&mut self) -> &mut Self::Target {
9598
&mut self.0
9699
}
@@ -445,6 +448,7 @@ pub fn fields(
445448
impl core::ops::Deref for #name_pc_r {
446449
type Target = crate::FieldReader<#fty, #name_pc_a>;
447450

451+
#[inline(always)]
448452
fn deref(&self) -> &Self::Target {
449453
&self.0
450454
}
@@ -542,6 +546,7 @@ pub fn fields(
542546
impl core::ops::Deref for #name_pc_r {
543547
type Target = crate::FieldReader<#fty, #name_pc_a>;
544548

549+
#[inline(always)]
545550
fn deref(&self) -> &Self::Target {
546551
&self.0
547552
}
@@ -562,6 +567,7 @@ pub fn fields(
562567
impl core::ops::Deref for #name_pc_r {
563568
type Target = crate::FieldReader<#fty, #fty>;
564569

570+
#[inline(always)]
565571
fn deref(&self) -> &Self::Target {
566572
&self.0
567573
}

0 commit comments

Comments
 (0)