Skip to content

Commit e7950d4

Browse files
committed
Tiny fixes
1 parent 166173b commit e7950d4

File tree

5 files changed

+11
-9
lines changed

5 files changed

+11
-9
lines changed

crates/cargo-gpu-cache/Cargo.toml

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,6 @@
11
[package]
22
name = "cargo-gpu-cache"
33
description = "Builder of `rust-gpu` shader crates"
4-
readme = "../../README.md"
54
version.workspace = true
65
edition.workspace = true
76
repository.workspace = true

crates/cargo-gpu-cache/src/lockfile.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -251,7 +251,7 @@ impl LockfileMismatchHandler {
251251
\n\
252252
One way to resolve this is to force the workspace to use the same version\n\
253253
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\
255255
also not ideal if you have many shaders sharing config from the workspace.\n\
256256
\n\
257257
Therefore `cargo gpu build/install` offers a workaround with the argument:\n\

crates/cargo-gpu-cache/src/metadata.rs

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -172,14 +172,16 @@ mod test {
172172

173173
#[test_log::test]
174174
fn can_override_config_from_crate_toml() {
175+
const PACKAGE_NAME: &str = env!("CARGO_PKG_NAME");
176+
175177
let mut metadata = MetadataCommand::new()
176178
.current_dir(env!("CARGO_MANIFEST_DIR"))
177179
.exec()
178180
.unwrap();
179181
let cargo_gpu = metadata
180182
.packages
181183
.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))
183185
.unwrap();
184186
cargo_gpu.metadata = serde_json::json!({
185187
"rust-gpu": {

crates/cargo-gpu/Cargo.toml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
[package]
22
name = "cargo-gpu"
33
description = "Command line tool for building Rust shaders using `rust-gpu`"
4+
readme = "../../README.md"
45
version.workspace = true
56
edition.workspace = true
67
repository.workspace = true

crates/cargo-gpu/src/main.rs

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -5,10 +5,12 @@
55
//!
66
//! For additional information see the [`cargo-gpu-cache`](cargo_gpu_cache) crate documentation.
77
8+
use std::process::ExitCode;
9+
810
use cargo_gpu_cache::Cli;
911
use clap::Parser as _;
1012

11-
fn main() {
13+
fn main() -> ExitCode {
1214
#[cfg(debug_assertions)]
1315
std::env::set_var("RUST_BACKTRACE", "1");
1416

@@ -23,13 +25,10 @@ fn main() {
2325
)]
2426
{
2527
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;
3129
};
3230
}
31+
ExitCode::SUCCESS
3332
}
3433

3534
/// Wrappable "main" to catch errors.
@@ -42,6 +41,7 @@ fn run() -> anyhow::Result<()> {
4241
})
4342
.collect::<Vec<_>>();
4443
log::trace!("CLI args: {env_args:#?}");
44+
4545
let cli = Cli::parse_from(&env_args);
4646
cli.command.run(env_args)
4747
}

0 commit comments

Comments
 (0)