Skip to content

Commit

Permalink
[ci] Run clippy (#10)
Browse files Browse the repository at this point in the history
  • Loading branch information
spacey-sooty authored Sep 2, 2024
1 parent c9ba3f5 commit ddecbee
Show file tree
Hide file tree
Showing 2 changed files with 29 additions and 4 deletions.
22 changes: 22 additions & 0 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -49,3 +49,25 @@ jobs:
run: pnpm install
- name: Build
run: pnpm tauri build

clippy:
runs-on: ubuntu-22.04
steps:
- uses: actions/checkout@v4
- name: Install Linux dependencies
run: |
sudo apt-get update -q
sudo apt-get install -y \
build-essential \
curl \
file \
libayatana-appindicator3-dev \
libgtk-3-dev \
librsvg2-dev \
libssl-dev \
libwebkit2gtk-4.0-dev \
libudev-dev \
wget
- name: Run cargo clippy
working-directory: src-tauri
run: cargo clippy --all
11 changes: 7 additions & 4 deletions src-tauri/src/main.rs
Original file line number Diff line number Diff line change
Expand Up @@ -223,7 +223,10 @@ fn main() {
let team_num: u32 = match team_num_string {
Ok(string) => string.parse().unwrap(),
Err(_) => {
File::create_new(&location).unwrap().write(b"4788").unwrap();
File::create_new(&location)
.unwrap()
.write_all(b"4788")
.unwrap();
4788
}
};
Expand All @@ -240,14 +243,14 @@ fn main() {
let mut out: Vec<Vec<JoystickValue>> = vec![];
for (_id, gamepad) in gilrs.gamepads() {
let mut values: Vec<JoystickValue> = vec![];
for i in BUTTONS.clone() {
for i in BUTTONS {
values.push(JoystickValue::Button {
id: i as u8,
pressed: gamepad.is_pressed(i),
})
}

for i in AXIS.clone() {
for i in AXIS {
values.push(JoystickValue::Axis {
id: i as u8,
value: gamepad.value(i),
Expand All @@ -256,7 +259,7 @@ fn main() {

out.push(values);
}
return out;
out
});
}

Expand Down

0 comments on commit ddecbee

Please sign in to comment.