From 1241896177178a7396697d76695fd11382f0283f Mon Sep 17 00:00:00 2001 From: Gwilym Kuiper Date: Sat, 7 Aug 2021 16:51:14 +0100 Subject: [PATCH] Fix clippy lints in agb-entry --- agb-entry/src/lib.rs | 10 +++------- 1 file changed, 3 insertions(+), 7 deletions(-) diff --git a/agb-entry/src/lib.rs b/agb-entry/src/lib.rs index a157cf7e..1e1482bf 100644 --- a/agb-entry/src/lib.rs +++ b/agb-entry/src/lib.rs @@ -4,7 +4,6 @@ use proc_macro::TokenStream; use proc_macro2::Span; use quote::quote; use syn::{ItemFn, ReturnType, Type, Visibility, Ident}; -use rand; use rand::Rng; #[proc_macro_attribute] @@ -20,10 +19,7 @@ pub fn entry(args: TokenStream, input: TokenStream) -> TokenStream { && f.sig.generics.params.is_empty() && f.sig.generics.where_clause.is_none() && match f.sig.output { - ReturnType::Type(_, ref ty) => match **ty { - Type::Never(_) => true, - _ => false, - }, + ReturnType::Type(_, ref ty) => matches!(**ty, Type::Never(_)), _ => false, }, "#[agb::entry] must have signature [unsafe] fn () -> !" @@ -50,9 +46,9 @@ fn random_ident() -> Ident { Ident::new( &(0..16).map(|i| { if i == 0 || rng.gen() { - ('a' as u8 + rng.gen::() % 25) as char + (b'a' + rng.gen::() % 25) as char } else { - ('0' as u8 + rng.gen::() % 10) as char + (b'0' + rng.gen::() % 10) as char } }).collect::(), Span::call_site()