Skip to content

Commit 409ecfd

Browse files
committed
change unreachable Err handling
1 parent 5bb4db7 commit 409ecfd

File tree

1 file changed

+3
-4
lines changed

1 file changed

+3
-4
lines changed

crates/cargo-gpu/src/install.rs

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -28,9 +28,8 @@ pub struct InstalledBackend {
2828
impl InstalledBackend {
2929
/// Creates a new `SpirvBuilder` configured to use this installed backend.
3030
#[expect(
31-
clippy::missing_panics_doc,
32-
clippy::expect_used,
33-
reason = "unreachable"
31+
clippy::unreachable,
32+
reason = "it's unreachable, no need to return a Result"
3433
)]
3534
#[expect(clippy::impl_trait_in_params, reason = "forwarding spirv-builder API")]
3635
#[inline]
@@ -41,7 +40,7 @@ impl InstalledBackend {
4140
) -> SpirvBuilder {
4241
let mut builder = SpirvBuilder::new(path_to_crate, target);
4342
self.configure_spirv_builder(&mut builder)
44-
.expect("unreachable");
43+
.unwrap_or_else(|_| unreachable!("we set target before calling this function"));
4544
builder
4645
}
4746

0 commit comments

Comments
 (0)