Skip to content

Commit f100519

Browse files
newAMthejpster
authored andcommitted
Fix new clippy lints
1 parent 9fd9741 commit f100519

File tree

2 files changed

+5
-11
lines changed

2 files changed

+5
-11
lines changed

cortex-m/src/peripheral/scb.rs

Lines changed: 2 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -646,10 +646,7 @@ impl SCB {
646646
/// a runtime-dependent `panic!()` call.
647647
#[inline]
648648
pub unsafe fn invalidate_dcache_by_slice<T>(&mut self, slice: &mut [T]) {
649-
self.invalidate_dcache_by_address(
650-
slice.as_ptr() as usize,
651-
slice.len() * core::mem::size_of::<T>(),
652-
);
649+
self.invalidate_dcache_by_address(slice.as_ptr() as usize, core::mem::size_of_val(slice));
653650
}
654651

655652
/// Cleans D-cache by address.
@@ -732,10 +729,7 @@ impl SCB {
732729
/// to main memory, overwriting whatever was in main memory.
733730
#[inline]
734731
pub fn clean_dcache_by_slice<T>(&mut self, slice: &[T]) {
735-
self.clean_dcache_by_address(
736-
slice.as_ptr() as usize,
737-
slice.len() * core::mem::size_of::<T>(),
738-
);
732+
self.clean_dcache_by_address(slice.as_ptr() as usize, core::mem::size_of_val(slice));
739733
}
740734

741735
/// Cleans and invalidates D-cache by address.

xtask/tests/ci.rs

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -27,9 +27,9 @@ static NON_BASE_TARGETS: &[&str] = &[
2727
fn build(package: &str, target: &str, features: &[&str]) {
2828
println!("building {} for {} {:?}", package, target, features);
2929
let mut cargo = Command::new("cargo");
30-
cargo.args(&["build", "-p", package, "--target", target]);
30+
cargo.args(["build", "-p", package, "--target", target]);
3131
for feat in features {
32-
cargo.args(&["--features", *feat]);
32+
cargo.args(["--features", *feat]);
3333
}
3434

3535
// Cargo features don't work right when invoked from the workspace root, so change to the
@@ -73,7 +73,7 @@ fn check_crates_build(is_nightly: bool, is_msrv: bool) {
7373
let used_features = &*all_features
7474
.iter()
7575
.copied()
76-
.filter(|feat| should_use_feature(*feat))
76+
.filter(|feat| should_use_feature(feat))
7777
.collect::<Vec<_>>();
7878

7979
// (note: we don't test with default features disabled, since we don't use them yet)

0 commit comments

Comments
 (0)