@@ -2,10 +2,10 @@ use std::str::FromStr;
22
33use http:: Method ;
44use proc_macro2:: { Ident , TokenStream } ;
5- use quote:: quote_spanned;
5+ use quote:: { quote_spanned, ToTokens } ;
66use 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 ,
99} ;
1010
1111#[ derive( Clone , Debug ) ]
@@ -433,7 +433,7 @@ impl HandlerAttrs {
433433 let c: u16 = i
434434 . base10_parse ( )
435435 . map_err ( |_| Error :: new_spanned ( i, "Invalid status code" ) ) ?;
436- if c < 100 || c >= 600 {
436+ if ! ( 100 .. 600 ) . contains ( & c ) {
437437 return Err ( Error :: new_spanned ( i, "Invalid status code" ) ) ;
438438 }
439439 nb_code += 1 ;
@@ -522,7 +522,7 @@ impl HandlerAttrs {
522522 let c: u16 = i
523523 . base10_parse ( )
524524 . map_err ( |_| Error :: new_spanned ( i, "Invalid status code" ) ) ?;
525- if c < 100 || c >= 600 {
525+ if ! ( 100 .. 600 ) . contains ( & c ) {
526526 return Err ( Error :: new_spanned ( i, "Invalid status code" ) ) ;
527527 }
528528 nb_code += 1 ;
0 commit comments