diff --git a/sugarloaf/src/renderer/mod.rs b/sugarloaf/src/renderer/mod.rs index f0371699..010aba0c 100644 --- a/sugarloaf/src/renderer/mod.rs +++ b/sugarloaf/src/renderer/mod.rs @@ -1368,13 +1368,14 @@ impl Renderer { Some(e) => e, None => continue, }; + // Without the `wgpu` feature `ImageTexture` only carries + // the `Metal` variant on macOS, so the match is + // infallible. Allow the clippy lint locally rather than + // splitting into two cfg branches; the Wgpu arm below is + // a real code path when the feature is on. + #[allow(clippy::infallible_destructuring_match)] let tex = match &img.gpu { ImageTexture::Metal(tex) => tex, - // The Wgpu variant only exists when the `wgpu` feature - // is enabled — without it, this match is exhaustive - // and the wildcard would be a clippy - // `unreachable_patterns`. Vulkan is gated to Linux, - // so it never reaches this Metal-only function. #[cfg(feature = "wgpu")] _ => continue, }; @@ -1428,9 +1429,11 @@ impl Renderer { Some(e) => e, None => return true, }; + // See `draw_images_metal` for why this is `#[allow]`-ed + + // the Wgpu arm is feature-gated. + #[allow(clippy::infallible_destructuring_match)] let tex = match &entry.gpu { ImageTexture::Metal(tex) => tex, - // See `draw_images_metal` for why the Wgpu arm is feature-gated. #[cfg(feature = "wgpu")] _ => return true, };