Skip to content

Commit 7cdf8c6

Browse files
authored
Merge pull request #490 from newAM/fix-clippy
Fix new clippy lints
2 parents 7f6ff8f + 0536991 commit 7cdf8c6

File tree

3 files changed

+14
-22
lines changed

3 files changed

+14
-22
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 & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -664,10 +664,7 @@ impl SCB {
664664
/// a runtime-dependent `panic!()` call.
665665
#[inline]
666666
pub unsafe fn invalidate_dcache_by_slice<T>(&mut self, slice: &mut [T]) {
667-
self.invalidate_dcache_by_address(
668-
slice.as_ptr() as usize,
669-
slice.len() * core::mem::size_of::<T>(),
670-
);
667+
self.invalidate_dcache_by_address(slice.as_ptr() as usize, core::mem::size_of_val(slice));
671668
}
672669

673670
/// Cleans D-cache by address.
@@ -750,10 +747,7 @@ impl SCB {
750747
/// to main memory, overwriting whatever was in main memory.
751748
#[inline]
752749
pub fn clean_dcache_by_slice<T>(&mut self, slice: &[T]) {
753-
self.clean_dcache_by_address(
754-
slice.as_ptr() as usize,
755-
slice.len() * core::mem::size_of::<T>(),
756-
);
750+
self.clean_dcache_by_address(slice.as_ptr() as usize, core::mem::size_of_val(slice));
757751
}
758752

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

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)