File tree Expand file tree Collapse file tree
crates/cargo-gpu-install/src Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -80,6 +80,7 @@ pub struct Install {
8080 clippy:: doc_markdown,
8181 reason = "The URL should appear literally like this. But Clippy wants a markdown clickable link"
8282 ) ]
83+ #[ expect( rustdoc:: bare_urls) ]
8384 /// Source of `spirv-builder` dependency
8485 /// Eg: "https://github.com/Rust-GPU/rust-gpu"
8586 #[ cfg_attr( feature = "clap" , clap( long) ) ]
Original file line number Diff line number Diff line change 11#![ expect( clippy:: pub_use, reason = "pub use for build scripts" ) ]
2- #![ expect(
3- missing_docs,
4- clippy:: missing_docs_in_private_items,
5- reason = "crate docs are cfg'ed out"
6- ) ]
2+ #![ expect( missing_docs, reason = "crate docs are cfg'ed out" ) ]
73#![ cfg_attr( doc, doc = include_str!( "../README.md" ) ) ]
84
95pub mod install;
Original file line number Diff line number Diff line change @@ -15,6 +15,7 @@ use std::path::{Path, PathBuf};
1515 clippy:: doc_markdown,
1616 reason = "The URL should appear literally like this. But Clippy wants a markdown clickable link"
1717) ]
18+ #[ expect( rustdoc:: bare_urls) ]
1819/// The source and version of `rust-gpu`.
1920/// Eg:
2021/// * From crates.io with version "0.10.0"
Original file line number Diff line number Diff line change @@ -39,8 +39,9 @@ impl TestEnv {
3939 }
4040
4141 /// Copies the `shader_crate_template` to the temp dir and returns the path to the directory.
42+ #[ expect( clippy:: unused_self) ]
4243 pub fn setup_shader_crate ( & self ) -> anyhow:: Result < PathBuf > {
43- let shader_crate_path = crate :: cache_dir ( ) . unwrap ( ) . join ( "shader_crate" ) ;
44+ let shader_crate_path = crate :: cache_dir ( ) ? . join ( "shader_crate" ) ;
4445 copy_dir_all ( shader_crate_template_path ( ) , & shader_crate_path) ?;
4546 Ok ( shader_crate_path)
4647 }
@@ -65,6 +66,12 @@ impl TestEnv {
6566 }
6667}
6768
69+ impl Default for TestEnv {
70+ fn default ( ) -> Self {
71+ Self :: new ( )
72+ }
73+ }
74+
6875impl Drop for TestEnv {
6976 fn drop ( & mut self ) {
7077 TESTDIR . replace ( None ) . unwrap ( ) ;
@@ -76,14 +83,14 @@ impl Drop for TestEnv {
7683}
7784
7885thread_local ! {
79- static TESTDIR : RefCell <Option <PathBuf >> = RefCell :: new( None ) ;
86+ static TESTDIR : RefCell <Option <PathBuf >> = const { RefCell :: new( None ) } ;
8087}
8188
8289/// [`crate::cache_dir`] for testing, see [`TestEnv`]
8390pub fn test_cache_dir ( ) -> anyhow:: Result < PathBuf > {
84- Ok ( TESTDIR . with_borrow ( |a| a. clone ( ) ) . context (
91+ TESTDIR . with_borrow ( |a| a. clone ( ) ) . context (
8592 "TestEnv is not initialized! Add `let _env = TestEnv::new();` to the beginning of your test" ,
86- ) ? )
93+ )
8794}
8895
8996fn copy_dir_all (
You can’t perform that action at this time.
0 commit comments