File tree Expand file tree Collapse file tree 2 files changed +7
-4
lines changed
Expand file tree Collapse file tree 2 files changed +7
-4
lines changed Original file line number Diff line number Diff line change 11use aws_lc_rs:: digest;
2- use std:: io:: Read ;
32use thiserror:: Error ;
43
54#[ derive( Error , Debug ) ]
Original file line number Diff line number Diff line change 1+ use anyhow:: Context ;
12use std:: path:: PathBuf ;
23use std:: { env, fs} ;
34
45fn main ( ) -> anyhow:: Result < ( ) > {
56 let out_dir = PathBuf :: from ( env:: var ( "OUT_DIR" ) ?) ;
67 let out_file = out_dir. join ( "schema.rs" ) ;
78
8- let schema = fs:: read_to_string ( "schema.tl" ) ?;
9- let schema = tl_parser:: parse_schema ( & schema) ?;
9+ let schema = fs:: read_to_string ( "schema.tl" )
10+ . context ( "Failed to read schema.tl" ) ?;
11+ let schema = tl_parser:: parse_schema ( & schema)
12+ . context ( "Failed to parse schema" ) ?;
1013 let code = tl_generator:: generate ( & schema) ;
1114
12- fs:: write ( out_file, code) ?;
15+ fs:: write ( out_file, code)
16+ . context ( "Failed to write generated code" ) ?;
1317
1418 Ok ( ( ) )
1519}
You can’t perform that action at this time.
0 commit comments