diff options
author | 2022-01-23 18:32:03 +0000 | |
---|---|---|
committer | 2022-01-23 18:32:03 +0000 | |
commit | 08111803edae11ab0fa4d0f287a865f434f4c12c (patch) | |
tree | b00e66deef005f0fcc57e997bfd5c7ed8bc3857e /cortex-m-rt | |
parent | c350114d8002d91bd71d08e7ad6ee2e960c2ed35 (diff) | |
parent | 000279dd5984e7f1de90c9225ddafdaea61ed0cb (diff) | |
download | cortex-m-08111803edae11ab0fa4d0f287a865f434f4c12c.tar.gz cortex-m-08111803edae11ab0fa4d0f287a865f434f4c12c.tar.zst cortex-m-08111803edae11ab0fa4d0f287a865f434f4c12c.zip |
Merge #415
415: Fix most clippy lints r=adamgreig a=newAM
This fixes all clippy lints that do not result in a user-visible change, and result in valid code for the 1.40 MSRV.
Co-authored-by: Alex Martens <alex@thinglab.org>
Diffstat (limited to 'cortex-m-rt')
-rw-r--r-- | cortex-m-rt/README.md | 2 | ||||
-rw-r--r-- | cortex-m-rt/macros/src/lib.rs | 16 | ||||
-rw-r--r-- | cortex-m-rt/src/lib.rs | 2 |
3 files changed, 7 insertions, 13 deletions
diff --git a/cortex-m-rt/README.md b/cortex-m-rt/README.md index 9857720..34b0f17 100644 --- a/cortex-m-rt/README.md +++ b/cortex-m-rt/README.md @@ -11,7 +11,7 @@ This project is developed and maintained by the [Cortex-M team][team]. # Minimum Supported Rust Version (MSRV) -This crate is guaranteed to compile on stable Rust 1.40.0 and up. It *might* +This crate is guaranteed to compile on stable Rust 1.42.0 and up. It *might* compile with older versions but that may change in any new patch release. # License diff --git a/cortex-m-rt/macros/src/lib.rs b/cortex-m-rt/macros/src/lib.rs index 817e9a1..24f3fa1 100644 --- a/cortex-m-rt/macros/src/lib.rs +++ b/cortex-m-rt/macros/src/lib.rs @@ -28,10 +28,7 @@ pub fn entry(args: TokenStream, input: TokenStream) -> TokenStream { && f.sig.variadic.is_none() && match f.sig.output { ReturnType::Default => false, - ReturnType::Type(_, ref ty) => match **ty { - Type::Never(_) => true, - _ => false, - }, + ReturnType::Type(_, ref ty) => matches!(**ty, Type::Never(_)), }; if !valid_signature { @@ -159,7 +156,7 @@ pub fn exception(args: TokenStream, input: TokenStream) -> TokenStream { Exception::DefaultHandler | Exception::HardFault | Exception::NonMaskableInt => { // These are unsafe to define. let name = if exn == Exception::DefaultHandler { - format!("`DefaultHandler`") + "`DefaultHandler`".to_string() } else { format!("`{:?}` handler", exn) }; @@ -252,10 +249,7 @@ pub fn exception(args: TokenStream, input: TokenStream) -> TokenStream { && f.sig.variadic.is_none() && match f.sig.output { ReturnType::Default => false, - ReturnType::Type(_, ref ty) => match **ty { - Type::Never(_) => true, - _ => false, - }, + ReturnType::Type(_, ref ty) => matches!(**ty, Type::Never(_)), }; if !valid_signature { @@ -557,7 +551,7 @@ fn extract_static_muts( let mut seen = HashSet::new(); let mut statics = vec![]; let mut stmts = vec![]; - while let Some(stmt) = istmts.next() { + for stmt in istmts.by_ref() { match stmt { Stmt::Item(Item::Static(var)) => { if var.mutability.is_some() { @@ -622,7 +616,7 @@ fn check_attr_whitelist(attrs: &[Attribute], caller: WhiteListCaller) -> Result< 'o: for attr in attrs { for val in whitelist { - if eq(&attr, &val) { + if eq(attr, val) { continue 'o; } } diff --git a/cortex-m-rt/src/lib.rs b/cortex-m-rt/src/lib.rs index 8003326..752d3d7 100644 --- a/cortex-m-rt/src/lib.rs +++ b/cortex-m-rt/src/lib.rs @@ -418,7 +418,7 @@ //! //! # Minimum Supported Rust Version (MSRV) //! -//! The MSRV of this release is Rust 1.40.0. +//! The MSRV of this release is Rust 1.42.0. // # Developer notes // |