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 proc_macro2::Span;
|
||||||
use quote::quote;
|
use quote::quote;
|
||||||
use syn::{ItemFn, ReturnType, Type, Visibility, Ident};
|
use syn::{ItemFn, ReturnType, Type, Visibility, Ident};
|
||||||
use rand;
|
|
||||||
use rand::Rng;
|
use rand::Rng;
|
||||||
|
|
||||||
#[proc_macro_attribute]
|
#[proc_macro_attribute]
|
||||||
|
@ -20,10 +19,7 @@ pub fn entry(args: TokenStream, input: TokenStream) -> TokenStream {
|
||||||
&& f.sig.generics.params.is_empty()
|
&& f.sig.generics.params.is_empty()
|
||||||
&& f.sig.generics.where_clause.is_none()
|
&& f.sig.generics.where_clause.is_none()
|
||||||
&& match f.sig.output {
|
&& match f.sig.output {
|
||||||
ReturnType::Type(_, ref ty) => match **ty {
|
ReturnType::Type(_, ref ty) => matches!(**ty, Type::Never(_)),
|
||||||
Type::Never(_) => true,
|
|
||||||
_ => false,
|
|
||||||
},
|
|
||||||
_ => false,
|
_ => false,
|
||||||
},
|
},
|
||||||
"#[agb::entry] must have signature [unsafe] fn () -> !"
|
"#[agb::entry] must have signature [unsafe] fn () -> !"
|
||||||
|
@ -50,9 +46,9 @@ fn random_ident() -> Ident {
|
||||||
Ident::new(
|
Ident::new(
|
||||||
&(0..16).map(|i| {
|
&(0..16).map(|i| {
|
||||||
if i == 0 || rng.gen() {
|
if i == 0 || rng.gen() {
|
||||||
('a' as u8 + rng.gen::<u8>() % 25) as char
|
(b'a' + rng.gen::<u8>() % 25) as char
|
||||||
} else {
|
} else {
|
||||||
('0' as u8 + rng.gen::<u8>() % 10) as char
|
(b'0' + rng.gen::<u8>() % 10) as char
|
||||||
}
|
}
|
||||||
}).collect::<String>(),
|
}).collect::<String>(),
|
||||||
Span::call_site()
|
Span::call_site()
|
||||||
|
|
Loading…
Add table
Reference in a new issue