Skip to content

Commit 1bb88f9

Browse files
schelltombh
authored andcommitted
appease clippy
1 parent 2ec6524 commit 1bb88f9

File tree

2 files changed

+13
-7
lines changed

2 files changed

+13
-7
lines changed

crates/cargo-gpu/src/show.rs

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -2,8 +2,9 @@
22
33
use crate::cache_dir;
44

5+
/// Show the computed source of the spirv-std dependency.
56
#[derive(Clone, Debug, clap::Parser)]
6-
pub struct ShowSpirvSource {
7+
pub struct SpirvSourceDep {
78
/// The location of the shader-crate to inspect to determine its spirv-std dependency.
89
#[clap(long, default_value = "./")]
910
pub shader_crate: std::path::PathBuf,
@@ -15,7 +16,7 @@ pub enum Info {
1516
/// Displays the location of the cache directory
1617
CacheDirectory,
1718
/// The source location of spirv-std
18-
SpirvSource(ShowSpirvSource),
19+
SpirvSource(SpirvSourceDep),
1920
}
2021

2122
/// `cargo gpu show`
@@ -34,7 +35,7 @@ impl Show {
3435
Info::CacheDirectory => {
3536
println!("{}", cache_dir().display());
3637
}
37-
Info::SpirvSource(ShowSpirvSource { shader_crate }) => {
38+
Info::SpirvSource(SpirvSourceDep { shader_crate }) => {
3839
let rust_gpu_source =
3940
crate::spirv_source::SpirvSource::get_spirv_std_dep_definition(&shader_crate);
4041
println!("{rust_gpu_source}");

crates/cargo-gpu/src/spirv_source.rs

Lines changed: 9 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,12 @@ pub enum SpirvSource {
2424
/// then the source of `rust-gpu` is `Git`.
2525
///
2626
/// `(String, String)` is the repo source and revision hash or tag.
27-
Git { url: String, rev: String },
27+
Git {
28+
/// URL of the repository
29+
url: String,
30+
/// Revision or "commitsh"
31+
rev: String,
32+
},
2833
/// If the shader specifies a version like:
2934
/// `spirv-std = { path = "/path/to/rust-gpu" ... }`
3035
/// then the source of `rust-gpu` is `Path`.
@@ -40,9 +45,9 @@ impl core::fmt::Display for SpirvSource {
4045
)]
4146
fn fmt(&self, f: &mut core::fmt::Formatter<'_>) -> core::fmt::Result {
4247
match self {
43-
SpirvSource::CratesIO(version) => f.write_str(version),
44-
SpirvSource::Git { url, rev } => f.write_str(&format!("{url}+{rev}")),
45-
SpirvSource::Path((a, b)) => f.write_str(&format!("{a}+{b}")),
48+
Self::CratesIO(version) => f.write_str(version),
49+
Self::Git { url, rev } => f.write_str(&format!("{url}+{rev}")),
50+
Self::Path((a, b)) => f.write_str(&format!("{a}+{b}")),
4651
}
4752
}
4853
}

0 commit comments

Comments
 (0)