diff options
author | 2020-03-14 10:57:52 +0000 | |
---|---|---|
committer | 2020-03-14 10:57:52 +0000 | |
commit | 2433d85190dad9e4cbaa4086eba796ab59bf0adb (patch) | |
tree | ebe6d29b0f9f9ad2ffde71db0e8e71c27ddc9bf2 /src | |
parent | 2bbfd8c976fed21e24865618b0a9975d9ab542c4 (diff) | |
download | cortex-m-2433d85190dad9e4cbaa4086eba796ab59bf0adb.tar.gz cortex-m-2433d85190dad9e4cbaa4086eba796ab59bf0adb.tar.zst cortex-m-2433d85190dad9e4cbaa4086eba796ab59bf0adb.zip |
Allow clippy::match_single_binding
Clippy complains that the match expressions used for cfg gating could be
rewritten as a let statement, this is a false positive.
Also adds inline on two functions.
Signed-off-by: Hugues de Valon <hugues.devalon@arm.com>
Diffstat (limited to 'src')
-rw-r--r-- | src/lib.rs | 2 | ||||
-rw-r--r-- | src/peripheral/scb.rs | 2 |
2 files changed, 4 insertions, 0 deletions
@@ -34,6 +34,8 @@ #![no_std] #![allow(clippy::identity_op)] #![allow(clippy::missing_safety_doc)] +// Prevent clippy from complaining about empty match expression that are used for cfg gating. +#![allow(clippy::match_single_binding)] // This makes clippy warn about public functions which are not #[inline]. // diff --git a/src/peripheral/scb.rs b/src/peripheral/scb.rs index dc82dc7..dfcc729 100644 --- a/src/peripheral/scb.rs +++ b/src/peripheral/scb.rs @@ -713,6 +713,7 @@ impl SCB { /// /// Cleaning the cache causes whatever data is present in the cache to be immediately written /// to main memory, overwriting whatever was in main memory. + #[inline] pub fn clean_dcache_by_ref<T>(&mut self, obj: &T) { self.clean_dcache_by_address(obj as *const T as usize, core::mem::size_of::<T>()); } @@ -729,6 +730,7 @@ impl SCB { /// /// Cleaning the cache causes whatever data is present in the cache to be immediately written /// to main memory, overwriting whatever was in main memory. + #[inline] pub fn clean_dcache_by_slice<T>(&mut self, slice: &[T]) { self.clean_dcache_by_address(slice.as_ptr() as usize, slice.len() * core::mem::size_of::<T>()); |