File tree Expand file tree Collapse file tree 1 file changed +18
-0
lines changed
Expand file tree Collapse file tree 1 file changed +18
-0
lines changed Original file line number Diff line number Diff line change @@ -675,6 +675,24 @@ impl SpirvBuilder {
675675 self
676676 }
677677
678+ /// Shortcut for `cargo check`
679+ pub fn check ( & mut self ) -> Result < CompileResult , SpirvBuilderError > {
680+ self . run_cargo_cmd ( "check" )
681+ }
682+
683+ /// Shortcut for `cargo clippy`
684+ pub fn clippy ( & mut self ) -> Result < CompileResult , SpirvBuilderError > {
685+ self . run_cargo_cmd ( "clippy" )
686+ }
687+
688+ /// Run the supplied cargo cmd, and ensure to reset the state so [`Self::build`] still works as normal
689+ fn run_cargo_cmd ( & mut self , cmd : & str ) -> Result < CompileResult , SpirvBuilderError > {
690+ let old = self . cargo_cmd . replace ( cmd. into ( ) ) ;
691+ let result = self . build ( ) ;
692+ self . cargo_cmd = old;
693+ result
694+ }
695+
678696 /// Builds the module. If `print_metadata` is [`MetadataPrintout::Full`], you usually don't have to inspect the path
679697 /// in the result, as the environment variable for the path to the module will already be set.
680698 pub fn build ( & self ) -> Result < CompileResult , SpirvBuilderError > {
You can’t perform that action at this time.
0 commit comments