Skip to content

Commit

Permalink
procmacros: Replace then_some
Browse files Browse the repository at this point in the history
which was just [recently stabilized in rust 1.62.0][1] and hence raises
the MSRV to 1.62.0 for all HALs. Use `bool::then` instead, which takes a
closure instead of a parameter but has the same effect otherwise and is
available [since rust 1.50.0][2].

[1]: rust-lang/rust#96628
[2]: https://doc.rust-lang.org/stable/std/primitive.bool.html#method.then
  • Loading branch information
har7an committed Aug 3, 2022
1 parent 4d4b60a commit 75218cf
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion esp-hal-procmacros/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -225,7 +225,7 @@ pub fn interrupt(args: TokenStream, input: TokenStream) -> TokenStream {
};

let context_call =
(f.sig.inputs.len() == 1).then_some(Ident::new("context", proc_macro2::Span::call_site()));
(f.sig.inputs.len() == 1).then(|| Ident::new("context", proc_macro2::Span::call_site()));

quote!(
#(#cfgs)*
Expand Down

0 comments on commit 75218cf

Please sign in to comment.