@@ -2,10 +2,10 @@ use std::str::FromStr;
2
2
3
3
use http:: Method ;
4
4
use proc_macro2:: { Ident , TokenStream } ;
5
- use quote:: quote_spanned;
5
+ use quote:: { quote_spanned, ToTokens } ;
6
6
use syn:: {
7
- export :: ToTokens , spanned:: Spanned , Attribute , Error , Expr , FnArg , GenericArgument , ImplItem , ImplItemMethod , ItemImpl , Lit , Meta , MetaNameValue ,
8
- NestedMeta , Pat , PatIdent , PatType , Path , PathArguments , PathSegment , Result , ReturnType , Type , TypePath ,
7
+ spanned:: Spanned , Attribute , Error , Expr , FnArg , GenericArgument , ImplItem , ImplItemMethod , ItemImpl , Lit , Meta , MetaNameValue , NestedMeta , Pat , PatIdent ,
8
+ PatType , Path , PathArguments , PathSegment , Result , ReturnType , Type , TypePath ,
9
9
} ;
10
10
11
11
#[ derive( Clone , Debug ) ]
@@ -433,7 +433,7 @@ impl HandlerAttrs {
433
433
let c: u16 = i
434
434
. base10_parse ( )
435
435
. map_err ( |_| Error :: new_spanned ( i, "Invalid status code" ) ) ?;
436
- if c < 100 || c >= 600 {
436
+ if ! ( 100 .. 600 ) . contains ( & c ) {
437
437
return Err ( Error :: new_spanned ( i, "Invalid status code" ) ) ;
438
438
}
439
439
nb_code += 1 ;
@@ -522,7 +522,7 @@ impl HandlerAttrs {
522
522
let c: u16 = i
523
523
. base10_parse ( )
524
524
. map_err ( |_| Error :: new_spanned ( i, "Invalid status code" ) ) ?;
525
- if c < 100 || c >= 600 {
525
+ if ! ( 100 .. 600 ) . contains ( & c ) {
526
526
return Err ( Error :: new_spanned ( i, "Invalid status code" ) ) ;
527
527
}
528
528
nb_code += 1 ;
0 commit comments