@@ -18,8 +18,7 @@ fn main() {
1818// When using clippy, we need to write a stubbed engine.wasm file to ensure compilation succeeds. This
1919// skips building the actual engine.wasm binary that would be injected into the CLI binary.
2020fn stub_engine_for_clippy ( ) {
21- let engine_path = PathBuf :: from ( env:: var ( "OUT_DIR" ) . unwrap ( ) )
22- . join ( "engine.wasm" ) ;
21+ let engine_path = PathBuf :: from ( env:: var ( "OUT_DIR" ) . unwrap ( ) ) . join ( "engine.wasm" ) ;
2322
2423 if !engine_path. exists ( ) {
2524 std:: fs:: write ( engine_path, & [ ] ) . expect ( "failed to write empty engine.wasm stub" ) ;
@@ -59,8 +58,7 @@ fn copy_engine_binary() {
5958 println ! ( "cargo:rerun-if-changed={:?}" , engine_path) ;
6059
6160 if engine_path. exists ( ) {
62- let copied_engine_path = PathBuf :: from ( env:: var ( "OUT_DIR" ) . unwrap ( ) )
63- . join ( "engine.wasm" ) ;
61+ let copied_engine_path = PathBuf :: from ( env:: var ( "OUT_DIR" ) . unwrap ( ) ) . join ( "engine.wasm" ) ;
6462
6563 fs:: copy ( & engine_path, & copied_engine_path) . unwrap ( ) ;
6664 optimize_engine ( & copied_engine_path) ;
@@ -78,10 +76,7 @@ fn optimize_engine(engine_path: impl AsRef<Path>) {
7876
7977fn run_wasm_strip ( engine_path : impl AsRef < Path > ) {
8078 let wasm_strip = which:: which ( "wasm-strip" )
81- . unwrap_or_else ( |_| {
82- PathBuf :: from ( env:: var ( "OUT_DIR" ) . unwrap ( ) )
83- . join ( "vendor/wasm-opt" )
84- } ) ;
79+ . unwrap_or_else ( |_| PathBuf :: from ( env:: var ( "OUT_DIR" ) . unwrap ( ) ) . join ( "vendor/wasm-opt" ) ) ;
8580
8681 let output = Command :: new ( wasm_strip)
8782 . arg ( engine_path. as_ref ( ) )
@@ -96,10 +91,7 @@ fn run_wasm_strip(engine_path: impl AsRef<Path>) {
9691
9792fn run_wasm_opt ( engine_path : impl AsRef < Path > ) {
9893 let wasm_opt = which:: which ( "wasm-opt" )
99- . unwrap_or_else ( |_| {
100- PathBuf :: from ( env:: var ( "OUT_DIR" ) . unwrap ( ) )
101- . join ( "vendor/wasm-opt" )
102- } ) ;
94+ . unwrap_or_else ( |_| PathBuf :: from ( env:: var ( "OUT_DIR" ) . unwrap ( ) ) . join ( "vendor/wasm-opt" ) ) ;
10395
10496 let output = Command :: new ( wasm_opt)
10597 . arg ( engine_path. as_ref ( ) )
0 commit comments