Skip to content

Commit 3e8bfb4

Browse files
2 parents 83197af + 0721895 commit 3e8bfb4

File tree

2 files changed

+62
-11
lines changed

2 files changed

+62
-11
lines changed

.github/workflows/build.yml

Lines changed: 58 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,58 @@
1+
name: Build (Linux)
2+
3+
on:
4+
push:
5+
branches:
6+
- "main"
7+
- "github-ci-test"
8+
pull_request:
9+
branches: [ "main" ]
10+
11+
jobs:
12+
build:
13+
strategy:
14+
matrix:
15+
os: [windows-latest, ubuntu-latest, macos-latest]
16+
runs-on: ${{ matrix.os }}
17+
18+
steps:
19+
- name: Checkout sources
20+
uses: actions/checkout@v4
21+
22+
- name: Install rust toolchain
23+
uses: dtolnay/rust-toolchain@stable
24+
25+
- uses: Swatinem/rust-cache@v2
26+
with:
27+
shared-key: "build"
28+
29+
- name: Run cargo check
30+
run: cargo check
31+
32+
33+
lints:
34+
name: Lints
35+
runs-on: ubuntu-latest
36+
steps:
37+
- name: Checkout sources
38+
uses: actions/checkout@v4
39+
40+
- name: Install rust toolchain
41+
uses: dtolnay/rust-toolchain@stable
42+
with:
43+
components: rustfmt, clippy
44+
45+
- uses: Swatinem/rust-cache@v2
46+
with:
47+
shared-key: "build"
48+
49+
- name: Run cargo fmt
50+
run: cargo fmt --all --check
51+
52+
- name: Run cargo clippy
53+
run: cargo clippy --workspace --all-targets -- -D warnings
54+
55+
- name: Run cargo doc
56+
run: cargo doc --no-deps --workspace --document-private-items
57+
env:
58+
RUSTDOCFLAGS: -D warnings

crates/eqx_window/src/window.rs

Lines changed: 4 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -152,10 +152,8 @@ impl<'a> State<'a> {
152152
}
153153
}
154154

155-
fn process_input(&self, event: &WindowEvent) -> bool {
156-
match event {
157-
_ => false,
158-
}
155+
fn process_input(&self) -> bool {
156+
false
159157
}
160158

161159
fn update(&self) {}
@@ -206,14 +204,9 @@ impl<'a> State<'a> {
206204
}
207205

208206
// TODO: refactor this class, so that more utilities (e.g. `Input`) can be integrated
207+
#[derive(Default)]
209208
pub struct WindowDisplay {}
210209

211-
impl Default for WindowDisplay {
212-
fn default() -> Self {
213-
WindowDisplay {}
214-
}
215-
}
216-
217210
impl Module for WindowDisplay {
218211
fn setup(&mut self) {}
219212

@@ -228,7 +221,7 @@ impl Module for WindowDisplay {
228221
ref event,
229222
window_id,
230223
} if window_id == state.window.id() => {
231-
if !state.process_input(event) {
224+
if !state.process_input() {
232225
match event {
233226
WindowEvent::CloseRequested
234227
| WindowEvent::KeyboardInput {

0 commit comments

Comments
 (0)