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) {
6161 let c_path = c_path. strip_prefix ( & cwd) . unwrap ( ) ;
6262 let rs_path = c_path. with_extension ( "rs" ) ;
6363 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+ } ;
6472 let debug_expr = format ! ( "cat {}" , rs_path. display( ) ) ;
6573
6674 let name = platform
67- . map ( |platform| [ "transpile" , platform ] . join ( "- ") )
75+ . map ( |platform| format ! ( "transpile-{platform} ") )
6876 . unwrap_or ( "transpile" . into ( ) ) ;
6977
7078 insta:: assert_snapshot!( name, & rs, & debug_expr) ;
You can’t perform that action at this time.
0 commit comments