From f197daf340be4685ce511a920406ba6c3ac29633 Mon Sep 17 00:00:00 2001 From: Albin Hedman Date: Mon, 18 Dec 2023 22:59:25 +0100 Subject: [PATCH] Fix clippy warnings --- src/flash.rs | 26 +++++++++++++------------- src/rcc/mod.rs | 36 ++++++++++++++++++------------------ 2 files changed, 31 insertions(+), 31 deletions(-) diff --git a/src/flash.rs b/src/flash.rs index 59cc9b9d..9edf1bfa 100644 --- a/src/flash.rs +++ b/src/flash.rs @@ -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() } } } @@ -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() } } } @@ -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() } } } @@ -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() } } } @@ -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() } } } @@ -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() } } } @@ -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() } } } @@ -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() } } } @@ -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() } } } @@ -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() } } } @@ -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() } } } @@ -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() } } } @@ -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() } } } diff --git a/src/rcc/mod.rs b/src/rcc/mod.rs index 61c871fd..86db82ee 100644 --- a/src/rcc/mod.rs +++ b/src/rcc/mod.rs @@ -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() } } @@ -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() } } @@ -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() } } @@ -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() } } @@ -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() } } @@ -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() } }