File tree Expand file tree Collapse file tree 5 files changed +11
-9
lines changed Expand file tree Collapse file tree 5 files changed +11
-9
lines changed Original file line number Diff line number Diff line change 1
1
[package ]
2
2
name = " cargo-gpu-cache"
3
3
description = " Builder of `rust-gpu` shader crates"
4
- readme = " ../../README.md"
5
4
version.workspace = true
6
5
edition.workspace = true
7
6
repository.workspace = true
Original file line number Diff line number Diff line change @@ -251,7 +251,7 @@ impl LockfileMismatchHandler {
251
251
\n \
252
252
One way to resolve this is to force the workspace to use the same version\n \
253
253
of Rust as required by the shader. However that is not often ideal or even\n \
254
- possible. Another way is to exlude the shader from the workspace. This is\n \
254
+ possible. Another way is to exclude the shader from the workspace. This is\n \
255
255
also not ideal if you have many shaders sharing config from the workspace.\n \
256
256
\n \
257
257
Therefore `cargo gpu build/install` offers a workaround with the argument:\n \
Original file line number Diff line number Diff line change @@ -172,14 +172,16 @@ mod test {
172
172
173
173
#[ test_log:: test]
174
174
fn can_override_config_from_crate_toml ( ) {
175
+ const PACKAGE_NAME : & str = env ! ( "CARGO_PKG_NAME" ) ;
176
+
175
177
let mut metadata = MetadataCommand :: new ( )
176
178
. current_dir ( env ! ( "CARGO_MANIFEST_DIR" ) )
177
179
. exec ( )
178
180
. unwrap ( ) ;
179
181
let cargo_gpu = metadata
180
182
. packages
181
183
. iter_mut ( )
182
- . find ( |package| package. name . contains ( "cargo-gpu-cache" ) ) // should be the name of this very crate
184
+ . find ( |package| package. name . contains ( PACKAGE_NAME ) )
183
185
. unwrap ( ) ;
184
186
cargo_gpu. metadata = serde_json:: json!( {
185
187
"rust-gpu" : {
Original file line number Diff line number Diff line change 1
1
[package ]
2
2
name = " cargo-gpu"
3
3
description = " Command line tool for building Rust shaders using `rust-gpu`"
4
+ readme = " ../../README.md"
4
5
version.workspace = true
5
6
edition.workspace = true
6
7
repository.workspace = true
Original file line number Diff line number Diff line change 5
5
//!
6
6
//! For additional information see the [`cargo-gpu-cache`](cargo_gpu_cache) crate documentation.
7
7
8
+ use std:: process:: ExitCode ;
9
+
8
10
use cargo_gpu_cache:: Cli ;
9
11
use clap:: Parser as _;
10
12
11
- fn main ( ) {
13
+ fn main ( ) -> ExitCode {
12
14
#[ cfg( debug_assertions) ]
13
15
std:: env:: set_var ( "RUST_BACKTRACE" , "1" ) ;
14
16
@@ -23,13 +25,10 @@ fn main() {
23
25
) ]
24
26
{
25
27
eprintln ! ( "Error: {error}" ) ;
26
-
27
- // `clippy::exit` seems to be a false positive in `main()`.
28
- // See: https://github.com/rust-lang/rust-clippy/issues/13518
29
- #[ expect( clippy:: restriction, reason = "Our central place for safely exiting" ) ]
30
- std:: process:: exit ( 1 ) ;
28
+ return ExitCode :: FAILURE ;
31
29
} ;
32
30
}
31
+ ExitCode :: SUCCESS
33
32
}
34
33
35
34
/// Wrappable "main" to catch errors.
@@ -42,6 +41,7 @@ fn run() -> anyhow::Result<()> {
42
41
} )
43
42
. collect :: < Vec < _ > > ( ) ;
44
43
log:: trace!( "CLI args: {env_args:#?}" ) ;
44
+
45
45
let cli = Cli :: parse_from ( & env_args) ;
46
46
cli. command . run ( env_args)
47
47
}
You can’t perform that action at this time.
0 commit comments