mirror of
https://github.com/italicsjenga/agb.git
synced 2025-01-23 07:36:33 +11:00
Fix clippy lints in agb-entry
This commit is contained in:
parent
bcfc8e506c
commit
1241896177
1 changed files with 3 additions and 7 deletions
|
@ -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::<u8>() % 25) as char
|
||||
(b'a' + rng.gen::<u8>() % 25) as char
|
||||
} else {
|
||||
('0' as u8 + rng.gen::<u8>() % 10) as char
|
||||
(b'0' + rng.gen::<u8>() % 10) as char
|
||||
}
|
||||
}).collect::<String>(),
|
||||
Span::call_site()
|
||||
|
|
Loading…
Add table
Reference in a new issue