Skip to content

Commit 2433d85

Browse files
committed
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 <[email protected]>
1 parent 2bbfd8c commit 2433d85

File tree

2 files changed

+4
-0
lines changed

2 files changed

+4
-0
lines changed

src/lib.rs

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -34,6 +34,8 @@
3434
#![no_std]
3535
#![allow(clippy::identity_op)]
3636
#![allow(clippy::missing_safety_doc)]
37+
// Prevent clippy from complaining about empty match expression that are used for cfg gating.
38+
#![allow(clippy::match_single_binding)]
3739

3840
// This makes clippy warn about public functions which are not #[inline].
3941
//

src/peripheral/scb.rs

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -713,6 +713,7 @@ impl SCB {
713713
///
714714
/// Cleaning the cache causes whatever data is present in the cache to be immediately written
715715
/// to main memory, overwriting whatever was in main memory.
716+
#[inline]
716717
pub fn clean_dcache_by_ref<T>(&mut self, obj: &T) {
717718
self.clean_dcache_by_address(obj as *const T as usize, core::mem::size_of::<T>());
718719
}
@@ -729,6 +730,7 @@ impl SCB {
729730
///
730731
/// Cleaning the cache causes whatever data is present in the cache to be immediately written
731732
/// to main memory, overwriting whatever was in main memory.
733+
#[inline]
732734
pub fn clean_dcache_by_slice<T>(&mut self, slice: &[T]) {
733735
self.clean_dcache_by_address(slice.as_ptr() as usize,
734736
slice.len() * core::mem::size_of::<T>());

0 commit comments

Comments
 (0)