Skip to content

Commit

Permalink
Fix clippy warnings
Browse files Browse the repository at this point in the history
  • Loading branch information
usbalbin committed Aug 6, 2024
1 parent 9337048 commit f197daf
Show file tree
Hide file tree
Showing 2 changed files with 31 additions and 31 deletions.
26 changes: 13 additions & 13 deletions src/flash.rs
Original file line number Diff line number Diff line change
Expand Up @@ -465,7 +465,7 @@ pub struct ACR {
impl ACR {
pub(crate) fn acr(&mut self) -> &flash::ACR {
// NOTE(unsafe) this proxy grants exclusive access to this register
unsafe { &(*FLASH::ptr()).acr() }
unsafe { (*FLASH::ptr()).acr() }
}
}

Expand All @@ -478,7 +478,7 @@ pub struct CR {
impl CR {
pub(crate) fn cr(&mut self) -> &flash::CR {
// NOTE(unsafe) this proxy grants exclusive access to this register
unsafe { &(*FLASH::ptr()).cr() }
unsafe { (*FLASH::ptr()).cr() }
}
}

Expand All @@ -491,7 +491,7 @@ pub struct ECCR {
impl ECCR {
pub(crate) fn eccr(&mut self) -> &flash::ECCR {
// NOTE(unsafe) this proxy grants exclusive access to this register
unsafe { &(*FLASH::ptr()).eccr() }
unsafe { (*FLASH::ptr()).eccr() }
}
}

Expand All @@ -504,7 +504,7 @@ pub struct KEYR {
impl KEYR {
pub(crate) fn keyr(&mut self) -> &flash::KEYR {
// NOTE(unsafe) this proxy grants exclusive access to this register
unsafe { &(*FLASH::ptr()).keyr() }
unsafe { (*FLASH::ptr()).keyr() }
}
}

Expand All @@ -517,7 +517,7 @@ pub struct OPTKEYR {
impl OPTKEYR {
pub(crate) fn optkeyr(&mut self) -> &flash::OPTKEYR {
// NOTE(unsafe) this proxy grants exclusive access to this register
unsafe { &(*FLASH::ptr()).optkeyr() }
unsafe { (*FLASH::ptr()).optkeyr() }
}
}

Expand All @@ -530,7 +530,7 @@ pub struct OPTR {
impl OPTR {
pub(crate) fn optr(&mut self) -> &flash::OPTR {
// NOTE(unsafe) this proxy grants exclusive access to this register
unsafe { &(*FLASH::ptr()).optr() }
unsafe { (*FLASH::ptr()).optr() }
}
}

Expand All @@ -543,7 +543,7 @@ pub struct PCROP1SR {
impl PCROP1SR {
pub(crate) fn pcrop1sr(&mut self) -> &flash::PCROP1SR {
// NOTE(unsafe) this proxy grants exclusive access to this register
unsafe { &(*FLASH::ptr()).pcrop1sr() }
unsafe { (*FLASH::ptr()).pcrop1sr() }
}
}

Expand All @@ -556,7 +556,7 @@ pub struct PCROP1ER {
impl PCROP1ER {
pub(crate) fn pcrop1er(&mut self) -> &flash::PCROP1ER {
// NOTE(unsafe) this proxy grants exclusive access to this register
unsafe { &(*FLASH::ptr()).pcrop1er() }
unsafe { (*FLASH::ptr()).pcrop1er() }
}
}

Expand All @@ -569,7 +569,7 @@ pub struct PDKEYR {
impl PDKEYR {
pub(crate) fn pdkeyr(&mut self) -> &flash::PDKEYR {
// NOTE(unsafe) this proxy grants exclusive access to this register
unsafe { &(*FLASH::ptr()).pdkeyr() }
unsafe { (*FLASH::ptr()).pdkeyr() }
}
}

Expand All @@ -582,7 +582,7 @@ pub struct SEC1R {
impl SEC1R {
pub(crate) fn sec1r(&mut self) -> &flash::SEC1R {
// NOTE(unsafe) this proxy grants exclusive access to this register
unsafe { &(*FLASH::ptr()).sec1r() }
unsafe { (*FLASH::ptr()).sec1r() }
}
}

Expand All @@ -595,7 +595,7 @@ pub struct SR {
impl SR {
pub(crate) fn sr(&mut self) -> &flash::SR {
// NOTE(unsafe) this proxy grants exclusive access to this register
unsafe { &(*FLASH::ptr()).sr() }
unsafe { (*FLASH::ptr()).sr() }
}
}

Expand All @@ -608,7 +608,7 @@ pub struct WRP1AR {
impl WRP1AR {
pub(crate) fn wrp1ar(&mut self) -> &flash::WRP1AR {
// NOTE(unsafe) this proxy grants exclusive access to this register
unsafe { &(*FLASH::ptr()).wrp1ar() }
unsafe { (*FLASH::ptr()).wrp1ar() }
}
}

Expand All @@ -621,6 +621,6 @@ pub struct WRP1BR {
impl WRP1BR {
pub(crate) fn wrp1br(&mut self) -> &flash::WRP1BR {
// NOTE(unsafe) this proxy grants exclusive access to this register
unsafe { &(*FLASH::ptr()).wrp1br() }
unsafe { (*FLASH::ptr()).wrp1br() }
}
}
36 changes: 18 additions & 18 deletions src/rcc/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -526,16 +526,16 @@ pub struct AHB1 {
impl AHB1 {
#[inline(always)]
fn enr(rcc: &RccRB) -> &rcc::AHB1ENR {
&rcc.ahb1enr()
rcc.ahb1enr()
}
#[inline(always)]
fn rstr(rcc: &RccRB) -> &rcc::AHB1RSTR {
&rcc.ahb1rstr()
rcc.ahb1rstr()
}
#[allow(unused)]
#[inline(always)]
fn smenr(rcc: &RccRB) -> &rcc::AHB1SMENR {
&rcc.ahb1smenr()
rcc.ahb1smenr()
}
}

Expand All @@ -545,16 +545,16 @@ pub struct AHB2 {
impl AHB2 {
#[inline(always)]
fn enr(rcc: &RccRB) -> &rcc::AHB2ENR {
&rcc.ahb2enr()
rcc.ahb2enr()
}
#[inline(always)]
fn rstr(rcc: &RccRB) -> &rcc::AHB2RSTR {
&rcc.ahb2rstr()
rcc.ahb2rstr()
}
#[allow(unused)]
#[inline(always)]
fn smenr(rcc: &RccRB) -> &rcc::AHB2SMENR {
&rcc.ahb2smenr()
rcc.ahb2smenr()
}
}

Expand All @@ -565,17 +565,17 @@ impl AHB3 {
#[allow(unused)]
#[inline(always)]
fn enr(rcc: &RccRB) -> &rcc::AHB3ENR {
&rcc.ahb3enr()
rcc.ahb3enr()
}
#[allow(unused)]
#[inline(always)]
fn rstr(rcc: &RccRB) -> &rcc::AHB3RSTR {
&rcc.ahb3rstr()
rcc.ahb3rstr()
}
#[allow(unused)]
#[inline(always)]
fn smenr(rcc: &RccRB) -> &rcc::AHB3SMENR {
&rcc.ahb3smenr()
rcc.ahb3smenr()
}
}

Expand All @@ -585,16 +585,16 @@ pub struct APB1_1 {
impl APB1_1 {
#[inline(always)]
fn enr(rcc: &RccRB) -> &rcc::APB1ENR1 {
&rcc.apb1enr1()
rcc.apb1enr1()
}
#[inline(always)]
fn rstr(rcc: &RccRB) -> &rcc::APB1RSTR1 {
&rcc.apb1rstr1()
rcc.apb1rstr1()
}
#[allow(unused)]
#[inline(always)]
fn smenr(rcc: &RccRB) -> &rcc::APB1SMENR1 {
&rcc.apb1smenr1()
rcc.apb1smenr1()
}
}

Expand All @@ -604,16 +604,16 @@ pub struct APB1_2 {
impl APB1_2 {
#[inline(always)]
fn enr(rcc: &RccRB) -> &rcc::APB1ENR2 {
&rcc.apb1enr2()
rcc.apb1enr2()
}
#[inline(always)]
fn rstr(rcc: &RccRB) -> &rcc::APB1RSTR2 {
&rcc.apb1rstr2()
rcc.apb1rstr2()
}
#[allow(unused)]
#[inline(always)]
fn smenr(rcc: &RccRB) -> &rcc::APB1SMENR2 {
&rcc.apb1smenr2()
rcc.apb1smenr2()
}
}

Expand All @@ -623,16 +623,16 @@ pub struct APB2 {
impl APB2 {
#[inline(always)]
fn enr(rcc: &RccRB) -> &rcc::APB2ENR {
&rcc.apb2enr()
rcc.apb2enr()
}
#[inline(always)]
fn rstr(rcc: &RccRB) -> &rcc::APB2RSTR {
&rcc.apb2rstr()
rcc.apb2rstr()
}
#[allow(unused)]
#[inline(always)]
fn smenr(rcc: &RccRB) -> &rcc::APB2SMENR {
&rcc.apb2smenr()
rcc.apb2smenr()
}
}

Expand Down

0 comments on commit f197daf

Please sign in to comment.