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 @@ -719,6 +719,24 @@ impl SpirvBuilder {
719719 self
720720 }
721721
722+ /// Shortcut for `cargo check`
723+ pub fn check ( & mut self ) -> Result < CompileResult , SpirvBuilderError > {
724+ self . run_cargo_cmd ( "check" )
725+ }
726+
727+ /// Shortcut for `cargo clippy`
728+ pub fn clippy ( & mut self ) -> Result < CompileResult , SpirvBuilderError > {
729+ self . run_cargo_cmd ( "clippy" )
730+ }
731+
732+ /// Run the supplied cargo cmd, and ensure to reset the state so [`Self::build`] still works as normal
733+ fn run_cargo_cmd ( & mut self , cmd : & str ) -> Result < CompileResult , SpirvBuilderError > {
734+ let old = self . cargo_cmd . replace ( cmd. into ( ) ) ;
735+ let result = self . build ( ) ;
736+ self . cargo_cmd = old;
737+ result
738+ }
739+
722740 /// Builds the module
723741 pub fn build ( & self ) -> Result < CompileResult , SpirvBuilderError > {
724742 let metadata_file = invoke_rustc ( self ) ?;
You can’t perform that action at this time.
0 commit comments