@@ -171,7 +171,8 @@ pub fn wasm_test_output_dir() -> std::path::PathBuf {
171171
172172#[ derive( Debug ) ]
173173pub struct RenderlingPaths {
174- /// `cargo_workspace` is not available when building outside of the project directory.
174+ /// `cargo_workspace` is not available when building outside of the project
175+ /// directory.
175176 pub cargo_workspace : Option < std:: path:: PathBuf > ,
176177 pub renderling_crate : std:: path:: PathBuf ,
177178 pub shader_dir : std:: path:: PathBuf ,
@@ -184,10 +185,12 @@ impl RenderlingPaths {
184185 ///
185186 /// If the `CARGO_WORKSPACE_DIR` and subsequently the `cargo_workspace` is
186187 /// _not_ available, this most likely means we're building renderling
187- /// outside of its own source tree, which means we **don't want to compile shaders**.
188+ /// outside of its own source tree, which means we **don't want to compile
189+ /// shaders**.
188190 ///
189- /// But we may still need to transpile the packaged SPIR-V into WGSL for WASM, and
190- /// so `cargo_workspace` is `Option` and the entire function also returns `Option`.
191+ /// But we may still need to transpile the packaged SPIR-V into WGSL for
192+ /// WASM, and so `cargo_workspace` is `Option` and the entire function
193+ /// also returns `Option`.
191194 pub fn new ( ) -> Option < Self > {
192195 let cargo_workspace = std:: env:: var ( "CARGO_WORKSPACE_DIR" )
193196 . map ( std:: path:: PathBuf :: from)
@@ -276,11 +279,14 @@ impl RenderlingPaths {
276279
277280 let contents = linkage. to_string ( ) ;
278281 std:: fs:: write ( & filepath, contents) . unwrap ( ) ;
279- std:: process:: Command :: new ( "rustfmt" )
280- . args ( [ & format ! ( "{}" , filepath. display( ) ) ] )
281- . output ( )
282- . expect ( "could not format generated code" ) ;
283282 }
283+ // Just format the whole project. I know this is less than ideal,
284+ // but people should be running with a formatter in their editor, and all of
285+ // this is temporary given the wgsl-rs re-stacking happening this year (2026)
286+ std:: process:: Command :: new ( "cargo" )
287+ . args ( [ "+nightly" , "fmt" ] )
288+ . output ( )
289+ . expect ( "could not format generated code" ) ;
284290 log:: info!( "...done!" )
285291 }
286292}
0 commit comments