Skip to content

Commit dd358a7

Browse files
authored
Run Clippy on all CI targets (#2636)
* Run Clippy on all CI targets * Fix macOS lints
1 parent a89d61c commit dd358a7

File tree

2 files changed

+21
-6
lines changed

2 files changed

+21
-6
lines changed

.github/workflows/rust.yml

+19-4
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,7 @@ jobs:
2626
runs-on: macos-latest
2727
self-hosted: false
2828
fail-fast: false
29-
name: ${{ matrix.name }}
29+
name: build / ${{ matrix.name }}
3030
runs-on: ${{ matrix.runs-on }}
3131
steps:
3232
- uses: actions/checkout@v4
@@ -42,14 +42,29 @@ jobs:
4242
- name: Build examples
4343
run: cargo build --profile=CI --verbose --bins
4444
clippy:
45-
runs-on: ubuntu-latest
45+
strategy:
46+
matrix:
47+
include:
48+
- name: windows-latest
49+
runs-on: [self-hosted, Windows]
50+
self-hosted: true
51+
- name: ubuntu-latest
52+
runs-on: ubuntu-latest
53+
self-hosted: false
54+
- name: macos-latest
55+
runs-on: macos-latest
56+
self-hosted: false
57+
fail-fast: false
58+
name: clippy / ${{ matrix.name }}
59+
runs-on: ${{ matrix.runs-on }}
4660
steps:
4761
- uses: actions/checkout@v4
4862
- run: rustup toolchain install stable --component clippy
4963
- uses: Swatinem/rust-cache@v2
64+
if: ${{ ! matrix.self-hosted }}
5065
with:
51-
shared-key: ubuntu-latest
52-
save-if: "false"
66+
shared-key: ${{ matrix.name }}
67+
save-if: false
5368
- name: Run clippy check
5469
run: cargo clippy --profile=CI -- -Dwarnings
5570
fmt:

vulkano/src/swapchain/surface.rs

+2-2
Original file line numberDiff line numberDiff line change
@@ -104,14 +104,14 @@ impl Surface {
104104
},
105105
#[cfg(target_vendor = "apple")]
106106
(RawWindowHandle::AppKit(handle), _) => {
107-
let layer = raw_window_metal::Layer::from_ns_view(handle.ns_view);
107+
let layer = unsafe { raw_window_metal::Layer::from_ns_view(handle.ns_view) };
108108

109109
// Vulkan retains the CAMetalLayer, so no need to retain it past this invocation
110110
unsafe { Self::from_metal(instance, layer.as_ptr().as_ptr(), None) }
111111
}
112112
#[cfg(target_vendor = "apple")]
113113
(RawWindowHandle::UiKit(handle), _) => {
114-
let layer = raw_window_metal::Layer::from_ui_view(handle.ui_view);
114+
let layer = unsafe { raw_window_metal::Layer::from_ui_view(handle.ui_view) };
115115

116116
// Vulkan retains the CAMetalLayer, so no need to retain it past this invocation
117117
unsafe { Self::from_metal(instance, layer.as_ptr().as_ptr(), None) }

0 commit comments

Comments
 (0)