File tree Expand file tree Collapse file tree 1 file changed +9
-1
lines changed Expand file tree Collapse file tree 1 file changed +9
-1
lines changed Original file line number Diff line number Diff line change @@ -61,10 +61,18 @@ fn transpile(platform: Option<&str>, c_path: &Path) {
61
61
let c_path = c_path. strip_prefix ( & cwd) . unwrap ( ) ;
62
62
let rs_path = c_path. with_extension ( "rs" ) ;
63
63
let rs = fs:: read_to_string ( & rs_path) . unwrap ( ) ;
64
+ let rs_path = match platform {
65
+ None => rs_path,
66
+ Some ( platform) => {
67
+ let platform_rs_path = rs_path. with_extension ( & format ! ( "{platform}.rs" ) ) ;
68
+ fs:: rename ( & rs_path, & platform_rs_path) . unwrap ( ) ;
69
+ platform_rs_path
70
+ }
71
+ } ;
64
72
let debug_expr = format ! ( "cat {}" , rs_path. display( ) ) ;
65
73
66
74
let name = platform
67
- . map ( |platform| [ "transpile" , platform ] . join ( "- ") )
75
+ . map ( |platform| format ! ( "transpile-{platform} ") )
68
76
. unwrap_or ( "transpile" . into ( ) ) ;
69
77
70
78
insta:: assert_snapshot!( name, & rs, & debug_expr) ;
You can’t perform that action at this time.
0 commit comments