Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[ci] Run clippy #10

Merged
merged 2 commits into from
Sep 2, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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