Skip to content

Commit 42a679e

Browse files
committed
Fix new clippy lints
1 parent 7f6ff8f commit 42a679e

File tree

3 files changed

+14
-16
lines changed

3 files changed

+14
-16
lines changed

cortex-m-semihosting/src/debug.rs

Lines changed: 7 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -11,16 +11,14 @@
1111
//! ```no_run
1212
//! use cortex_m_semihosting::debug::{self, EXIT_SUCCESS, EXIT_FAILURE};
1313
//!
14-
//! fn main() {
15-
//! if 2 == 2 {
16-
//! // report success
17-
//! debug::exit(EXIT_SUCCESS);
18-
//! } else {
19-
//! // report failure
20-
//! debug::exit(EXIT_FAILURE);
21-
//! }
14+
//! if 2 == 2 {
15+
//! // report success
16+
//! debug::exit(EXIT_SUCCESS);
17+
//! } else {
18+
//! // report failure
19+
//! debug::exit(EXIT_FAILURE);
2220
//! }
23-
//!
21+
//! ```
2422
2523
/// This values are taken from section 5.5.2 of
2624
/// ADS Debug Target Guide (DUI0058).

cortex-m/src/peripheral/scb.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -666,7 +666,7 @@ impl SCB {
666666
pub unsafe fn invalidate_dcache_by_slice<T>(&mut self, slice: &mut [T]) {
667667
self.invalidate_dcache_by_address(
668668
slice.as_ptr() as usize,
669-
slice.len() * core::mem::size_of::<T>(),
669+
core::mem::size_of_val(slice),
670670
);
671671
}
672672

@@ -752,7 +752,7 @@ impl SCB {
752752
pub fn clean_dcache_by_slice<T>(&mut self, slice: &[T]) {
753753
self.clean_dcache_by_address(
754754
slice.as_ptr() as usize,
755-
slice.len() * core::mem::size_of::<T>(),
755+
core::mem::size_of_val(slice),
756756
);
757757
}
758758

xtask/tests/ci.rs

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -27,16 +27,16 @@ 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
// A `critical_section` implementation is always needed.
3636
if package == "cortex-m" {
37-
cargo.args(&["--features", "critical-section-single-core"]);
37+
cargo.args(["--features", "critical-section-single-core"]);
3838
} else {
39-
cargo.args(&["--features", "cortex-m/critical-section-single-core"]);
39+
cargo.args(["--features", "cortex-m/critical-section-single-core"]);
4040
}
4141

4242
// Cargo features don't work right when invoked from the workspace root, so change to the
@@ -77,7 +77,7 @@ fn check_crates_build(_is_nightly: bool) {
7777
let used_features = &*all_features
7878
.iter()
7979
.copied()
80-
.filter(|feat| should_use_feature(*feat))
80+
.filter(|feat| should_use_feature(feat))
8181
.collect::<Vec<_>>();
8282

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

0 commit comments

Comments
 (0)