Skip to content

Commit e680ce7

Browse files
committed
clippy
1 parent bfdbfdc commit e680ce7

File tree

3 files changed

+13
-3
lines changed

3 files changed

+13
-3
lines changed

clippy.toml

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,2 @@
11
allow-unwrap-in-tests = true
22
allow-panic-in-tests = true
3-
allow-shadow-reuse = true

crates/cargo-gpu/src/build.rs

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,5 @@
1+
#![allow(clippy::shadow_reuse, reason = "let's not be silly")]
2+
#![allow(clippy::unwrap_used, reason = "this is basically a test")]
13
//! `cargo gpu build`, analogous to `cargo build`
24
35
use anyhow::Context as _;

crates/xtask/src/main.rs

Lines changed: 11 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,10 @@
11
//! Project/repository utilities.
2+
#![allow(clippy::shadow_reuse, reason = "sometimes its nice")]
3+
#![allow(clippy::unwrap_used, reason = "sometimes its good")]
4+
#![allow(clippy::unwrap_in_result, reason = "sometimes that's what you want")]
25

3-
use anyhow::Context;
4-
use clap::Parser;
6+
use anyhow::Context as _;
7+
use clap::Parser as _;
58

69
/// Our xtask commands.
710
#[derive(Debug, clap::Parser)]
@@ -27,8 +30,11 @@ fn cmd(args: impl IntoIterator<Item = impl AsRef<str>>) -> anyhow::Result<()> {
2730
Ok(())
2831
}
2932

33+
/// Overwrites a toml file's output-dir field, and reverts that on drop.
3034
struct ShaderCrateTemplateCargoTomlWriter {
35+
/// Original string
3136
original_shader_crate_template_str: String,
37+
/// Parsed toml table
3238
table: toml::Table,
3339
}
3440

@@ -40,8 +46,10 @@ impl Drop for ShaderCrateTemplateCargoTomlWriter {
4046
}
4147

4248
impl ShaderCrateTemplateCargoTomlWriter {
49+
/// Path to the Cargo.toml
4350
const PATH: &str = "crates/shader-crate-template/Cargo.toml";
4451

52+
/// Create a new one
4553
fn new() -> Self {
4654
let original_shader_crate_template_str = std::fs::read_to_string(Self::PATH).unwrap();
4755
let table = toml::from_str::<toml::Table>(&original_shader_crate_template_str).unwrap();
@@ -51,6 +59,7 @@ impl ShaderCrateTemplateCargoTomlWriter {
5159
}
5260
}
5361

62+
/// Replace the output-dir
5463
fn replace_output_dir(&mut self, path: impl AsRef<std::path::Path>) -> anyhow::Result<()> {
5564
let package = self
5665
.table

0 commit comments

Comments
 (0)