File tree Expand file tree Collapse file tree 1 file changed +9
-2
lines changed
Expand file tree Collapse file tree 1 file changed +9
-2
lines changed Original file line number Diff line number Diff line change @@ -9,10 +9,17 @@ pub fn derive_environment(input: TokenStream) -> TokenStream {
99
1010 let ident = input. ident ;
1111 let Data :: Struct ( struct_data) = input. data else {
12- panic ! ( "environment parser can only be derived on structs" ) ;
12+ return syn:: Error :: new_spanned ( ident, "environment parser can only be derived on structs" )
13+ . to_compile_error ( )
14+ . into ( ) ;
1315 } ;
1416 let Fields :: Named ( fields) = struct_data. fields else {
15- panic ! ( "environment parser can only be derived on structs whose fields have names" ) ;
17+ return syn:: Error :: new_spanned (
18+ ident,
19+ "environment parser can only be derived on structs whose fields have names" ,
20+ )
21+ . to_compile_error ( )
22+ . into ( ) ;
1623 } ;
1724
1825 let ( prefix, suffix) = parenv_mata_values ( & input. attrs ) ;
You can’t perform that action at this time.
0 commit comments