Skip to content

Commit 3e80557

Browse files
committed
Fix most clippy lints
1 parent c350114 commit 3e80557

File tree

3 files changed

+7
-7
lines changed

3 files changed

+7
-7
lines changed

cortex-m-rt/macros/src/lib.rs

+3-3
Original file line numberDiff line numberDiff line change
@@ -159,7 +159,7 @@ pub fn exception(args: TokenStream, input: TokenStream) -> TokenStream {
159159
Exception::DefaultHandler | Exception::HardFault | Exception::NonMaskableInt => {
160160
// These are unsafe to define.
161161
let name = if exn == Exception::DefaultHandler {
162-
format!("`DefaultHandler`")
162+
"`DefaultHandler`".to_string()
163163
} else {
164164
format!("`{:?}` handler", exn)
165165
};
@@ -557,7 +557,7 @@ fn extract_static_muts(
557557
let mut seen = HashSet::new();
558558
let mut statics = vec![];
559559
let mut stmts = vec![];
560-
while let Some(stmt) = istmts.next() {
560+
for stmt in istmts.by_ref() {
561561
match stmt {
562562
Stmt::Item(Item::Static(var)) => {
563563
if var.mutability.is_some() {
@@ -622,7 +622,7 @@ fn check_attr_whitelist(attrs: &[Attribute], caller: WhiteListCaller) -> Result<
622622

623623
'o: for attr in attrs {
624624
for val in whitelist {
625-
if eq(&attr, &val) {
625+
if eq(attr, val) {
626626
continue 'o;
627627
}
628628
}

xtask/src/lib.rs

+2-2
Original file line numberDiff line numberDiff line change
@@ -232,15 +232,15 @@ pub fn check_host_side() {
232232
{
233233
let a = VectActive::from(19).unwrap();
234234
let b = VectActive::from(20).unwrap();
235-
assert_eq!(a < b, true);
235+
assert!(a < b);
236236
}
237237

238238
// check TryFrom
239239
{
240240
use core::convert::TryInto;
241241
use std::convert::TryFrom;
242242

243-
let lts: LocalTimestampOptions = (16 as u8).try_into().unwrap();
243+
let lts: LocalTimestampOptions = (16_u8).try_into().unwrap();
244244
assert_eq!(lts, LocalTimestampOptions::EnabledDiv16);
245245

246246
assert!(LocalTimestampOptions::try_from(42).is_err());

xtask/src/main.rs

+2-2
Original file line numberDiff line numberDiff line change
@@ -2,8 +2,8 @@ use std::{env, process};
22
use xtask::{assemble_blobs, check_blobs, check_host_side};
33

44
fn main() {
5-
let subcommand = env::args().skip(1).next();
6-
match subcommand.as_ref().map(|s| &**s) {
5+
let subcommand = env::args().nth(1);
6+
match subcommand.as_deref() {
77
Some("assemble") => assemble_blobs(),
88
Some("check-blobs") => check_blobs(),
99
Some("check-host-side") => check_host_side(),

0 commit comments

Comments
 (0)