File tree Expand file tree Collapse file tree
crates/snforge-scarb-plugin/src Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -15,9 +15,8 @@ pub fn fuzzable_derive(item: &TokenStream) -> ProcMacroResult {
1515 let db = SimpleParserDatabase :: default ( ) ;
1616 let ( parsed, diagnostics) = db. parse_token_stream ( item) ;
1717
18- if !diagnostics. is_empty ( ) {
19- return ProcMacroResult :: new ( TokenStream :: empty ( ) )
20- . with_diagnostics ( Diagnostic :: error ( "Failed because of invalid syntax" ) . into ( ) ) ;
18+ if diagnostics. check_error_free ( ) . is_err ( ) {
19+ return ProcMacroResult :: new ( TokenStream :: empty ( ) ) ;
2120 }
2221
2322 let syntax_db = db. upcast ( ) ;
Original file line number Diff line number Diff line change @@ -12,12 +12,12 @@ use cairo_lang_utils::Upcast;
1212
1313pub fn parse < T : AttributeInfo > (
1414 code : & TokenStream ,
15- ) -> Result < ( SimpleParserDatabase , FunctionWithBody ) , Diagnostic > {
15+ ) -> Result < ( SimpleParserDatabase , FunctionWithBody ) , Vec < Diagnostic > > {
1616 let simple_db = SimpleParserDatabase :: default ( ) ;
1717 let ( parsed_node, diagnostics) = simple_db. parse_token_stream ( code) ;
1818
19- if ! diagnostics. is_empty ( ) {
20- return Err ( Diagnostic :: error ( "Failed because of invalid syntax" ) ) ;
19+ if diagnostics. check_error_free ( ) . is_err ( ) {
20+ return Err ( vec ! [ ] ) ;
2121 }
2222
2323 let db = simple_db. upcast ( ) ;
@@ -34,7 +34,7 @@ pub fn parse<T: AttributeInfo>(
3434
3535 match function {
3636 Some ( func) => Ok ( ( simple_db, func) ) ,
37- None => Err ( T :: error ( "can be used only on a function" ) ) ,
37+ None => Err ( vec ! [ T :: error( "can be used only on a function" ) ] ) ,
3838 }
3939}
4040
You can’t perform that action at this time.
0 commit comments