Skip to content

Hand tracking gestures (#1794) #502

Hand tracking gestures (#1794)

Hand tracking gestures (#1794) #502

Triggered via push September 12, 2023 02:33
Status Success
Total duration 22s
Artifacts
This run and associated checks have been archived and are scheduled for deletion. Learn more about checks retention

wiki.yml

on: push
Fit to window
Zoom out
Zoom in

Annotations

34 warnings
wiki
The following actions uses node12 which is deprecated and will be forced to run on node16: actions/checkout@v2, cmbrose/github-docs-to-wiki@v0.24. For more info: https://github.blog/changelog/2023-06-13-github-actions-all-actions-will-run-on-node16-instead-of-node12-by-default/
writing `&Vec` instead of `&[_]` involves a new object where a slice will do: alvr/server/src/hand_gestures.rs#L569
warning: writing `&Vec` instead of `&[_]` involves a new object where a slice will do --> alvr/server/src/hand_gestures.rs:569:15 | 569 | gestures: &Vec<HandGesture>, | ^^^^^^^^^^^^^^^^^ help: change this to: `&[HandGesture]` | = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#ptr_arg = note: `#[warn(clippy::ptr_arg)]` on by default
called `unwrap` on `hover_bind` after checking its variant with `is_some`: alvr/server/src/hand_gestures.rs#L594
warning: called `unwrap` on `hover_bind` after checking its variant with `is_some` --> alvr/server/src/hand_gestures.rs:594:17 | 592 | if hover_bind.is_some() { | ----------------------- help: try: `if let Some(..) = hover_bind` 593 | button_mapping_manager.report_button( 594 | hover_bind.unwrap(), | ^^^^^^^^^^^^^^^^^^^ | = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#unnecessary_unwrap
called `unwrap` on `touch_bind` after checking its variant with `is_some`: alvr/server/src/hand_gestures.rs#L585
warning: called `unwrap` on `touch_bind` after checking its variant with `is_some` --> alvr/server/src/hand_gestures.rs:585:17 | 583 | if touch_bind.is_some() { | ----------------------- help: try: `if let Some(..) = touch_bind` 584 | button_mapping_manager.report_button( 585 | touch_bind.unwrap(), | ^^^^^^^^^^^^^^^^^^^ | = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#unnecessary_unwrap
called `unwrap` on `click_bind` after checking its variant with `is_some`: alvr/server/src/hand_gestures.rs#L576
warning: called `unwrap` on `click_bind` after checking its variant with `is_some` --> alvr/server/src/hand_gestures.rs:576:17 | 574 | if click_bind.is_some() { | ----------------------- help: try: `if let Some(..) = click_bind` 575 | button_mapping_manager.report_button( 576 | click_bind.unwrap(), | ^^^^^^^^^^^^^^^^^^^ | = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#unnecessary_unwrap = note: `#[warn(clippy::unnecessary_unwrap)]` on by default
this function has too many arguments (8/7): alvr/server/src/hand_gestures.rs#L480
warning: this function has too many arguments (8/7) --> alvr/server/src/hand_gestures.rs:480:5 | 480 | / fn get_joystick_values( 481 | | &self, 482 | | center: Pose, 483 | | anchor: Pose, ... | 488 | | offset_vert: f32, 489 | | ) -> Vec2 { | |_____________^ | = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#too_many_arguments
usage of `contains_key` followed by `insert` on a `HashMap`: alvr/server/src/hand_gestures.rs#L384
warning: usage of `contains_key` followed by `insert` on a `HashMap` --> alvr/server/src/hand_gestures.rs:384:9 | 384 | / if !gesture_data.contains_key(&gesture_id) { 385 | | gesture_data.insert( 386 | | gesture_id, 387 | | GestureAction { ... | 396 | | ); 397 | | } | |_________^ | = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#map_entry = note: `#[warn(clippy::map_entry)]` on by default help: try this | 384 ~ gesture_data.entry(gesture_id).or_insert(GestureAction { 385 + last_activated: 0, 386 + last_deactivated: 0, 387 + entering: false, 388 + entering_since: 0, 389 + exiting: false, 390 + exiting_since: 0, 391 + active: false, 392 + }); |
this function has too many arguments (11/7): alvr/server/src/hand_gestures.rs#L362
warning: this function has too many arguments (11/7) --> alvr/server/src/hand_gestures.rs:362:5 | 362 | / fn is_gesture_active( 363 | | &mut self, 364 | | gesture_id: HandGestureId, 365 | | first_anchor: Pose, ... | 373 | | device_id: u64, 374 | | ) -> bool { | |_____________^ | = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#too_many_arguments = note: `#[warn(clippy::too_many_arguments)]` on by default
using `Option.and_then(|x| Some(y))`, which is more succinctly expressed as `map(|x| y)`: alvr/server/src/connection.rs#L660
warning: using `Option.and_then(|x| Some(y))`, which is more succinctly expressed as `map(|x| y)` --> alvr/server/src/connection.rs:660:17 | 660 | / config.hand_tracking.use_gestures.as_option().and_then(|_| { 661 | | Some(ButtonMappingManager::new_automatic( 662 | | &HAND_GESTURE_BUTTON_SET, 663 | | &config.button_mapping_config, 664 | | )) 665 | | }) | |__________________^ | = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#bind_instead_of_map = note: `#[warn(clippy::bind_instead_of_map)]` on by default help: try this | 660 ~ config.hand_tracking.use_gestures.as_option().map(|_| ButtonMappingManager::new_automatic( 661 + &HAND_GESTURE_BUTTON_SET, 662 + &config.button_mapping_config, 663 + )) |
the borrowed expression implements the required traits: alvr/launcher/src/main.rs#L761
warning: the borrowed expression implements the required traits --> alvr/launcher/src/main.rs:761:24 | 761 | fs::create_dir_all(&installation_dir)?; | ^^^^^^^^^^^^^^^^^ help: change this to: `installation_dir` | = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_borrow = note: `#[warn(clippy::needless_borrow)]` on by default
variable does not need to be mutable: alvr/launcher/src/main.rs#L759
warning: variable does not need to be mutable --> alvr/launcher/src/main.rs:759:9 | 759 | let mut installation_dir = data_dir().extended(VERSIONS_SUBDIR).extended(&release.tag); | ----^^^^^^^^^^^^^^^^ | | | help: remove this `mut` | = note: `#[warn(unused_mut)]` on by default
unused variable: `buffer`: alvr/launcher/src/main.rs#L757
warning: unused variable: `buffer` --> alvr/launcher/src/main.rs:757:9 | 757 | let buffer = download(tx, "Downloading Streamer", &url, client).await?; | ^^^^^^ help: if this is intentional, prefix it with an underscore: `_buffer` | = note: `#[warn(unused_variables)]` on by default
unreachable expression: alvr/launcher/src/main.rs#L780
warning: unreachable expression --> alvr/launcher/src/main.rs:780:5 | 763 | / match installation_type { 764 | | #[cfg(target_os = "linux")] 765 | | InstallationType::AppImage => { 766 | | installation_dir.push("ALVR-x86_64.AppImage"); ... | 778 | | } 779 | | } | |_____- any code following this `match` expression is unreachable, as all arms diverge 780 | Ok(()) | ^^^^^^ unreachable expression | = note: `#[warn(unreachable_code)]` on by default
unused import: `Permissions`: alvr/launcher/src/main.rs#L6
warning: unused import: `Permissions` --> alvr/launcher/src/main.rs:6:22 | 6 | fs::{self, File, Permissions}, | ^^^^^^^^^^^ | = note: `#[warn(unused_imports)]` on by default
writing `&Vec` instead of `&[_]` involves a new object where a slice will do: alvr\server\src\hand_gestures.rs#L569
warning: writing `&Vec` instead of `&[_]` involves a new object where a slice will do --> alvr\server\src\hand_gestures.rs:569:15 | 569 | gestures: &Vec<HandGesture>, | ^^^^^^^^^^^^^^^^^ help: change this to: `&[HandGesture]` | = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#ptr_arg = note: `#[warn(clippy::ptr_arg)]` on by default
called `unwrap` on `hover_bind` after checking its variant with `is_some`: alvr\server\src\hand_gestures.rs#L594
warning: called `unwrap` on `hover_bind` after checking its variant with `is_some` --> alvr\server\src\hand_gestures.rs:594:17 | 592 | if hover_bind.is_some() { | ----------------------- help: try: `if let Some(..) = hover_bind` 593 | button_mapping_manager.report_button( 594 | hover_bind.unwrap(), | ^^^^^^^^^^^^^^^^^^^ | = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#unnecessary_unwrap
called `unwrap` on `touch_bind` after checking its variant with `is_some`: alvr\server\src\hand_gestures.rs#L585
warning: called `unwrap` on `touch_bind` after checking its variant with `is_some` --> alvr\server\src\hand_gestures.rs:585:17 | 583 | if touch_bind.is_some() { | ----------------------- help: try: `if let Some(..) = touch_bind` 584 | button_mapping_manager.report_button( 585 | touch_bind.unwrap(), | ^^^^^^^^^^^^^^^^^^^ | = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#unnecessary_unwrap
called `unwrap` on `click_bind` after checking its variant with `is_some`: alvr\server\src\hand_gestures.rs#L576
warning: called `unwrap` on `click_bind` after checking its variant with `is_some` --> alvr\server\src\hand_gestures.rs:576:17 | 574 | if click_bind.is_some() { | ----------------------- help: try: `if let Some(..) = click_bind` 575 | button_mapping_manager.report_button( 576 | click_bind.unwrap(), | ^^^^^^^^^^^^^^^^^^^ | = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#unnecessary_unwrap = note: `#[warn(clippy::unnecessary_unwrap)]` on by default
this function has too many arguments (8/7): alvr\server\src\hand_gestures.rs#L480
warning: this function has too many arguments (8/7) --> alvr\server\src\hand_gestures.rs:480:5 | 480 | / fn get_joystick_values( 481 | | &self, 482 | | center: Pose, 483 | | anchor: Pose, ... | 488 | | offset_vert: f32, 489 | | ) -> Vec2 { | |_____________^ | = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#too_many_arguments
usage of `contains_key` followed by `insert` on a `HashMap`: alvr\server\src\hand_gestures.rs#L384
warning: usage of `contains_key` followed by `insert` on a `HashMap` --> alvr\server\src\hand_gestures.rs:384:9 | 384 | / if !gesture_data.contains_key(&gesture_id) { 385 | | gesture_data.insert( 386 | | gesture_id, 387 | | GestureAction { ... | 396 | | ); 397 | | } | |_________^ | = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#map_entry = note: `#[warn(clippy::map_entry)]` on by default help: try this | 384 ~ gesture_data.entry(gesture_id).or_insert(GestureAction { 385 + last_activated: 0, 386 + last_deactivated: 0, 387 + entering: false, 388 + entering_since: 0, 389 + exiting: false, 390 + exiting_since: 0, 391 + active: false, 392 + }); |
this function has too many arguments (11/7): alvr\server\src\hand_gestures.rs#L362
warning: this function has too many arguments (11/7) --> alvr\server\src\hand_gestures.rs:362:5 | 362 | / fn is_gesture_active( 363 | | &mut self, 364 | | gesture_id: HandGestureId, 365 | | first_anchor: Pose, ... | 373 | | device_id: u64, 374 | | ) -> bool { | |_____________^ | = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#too_many_arguments = note: `#[warn(clippy::too_many_arguments)]` on by default
calls to `push` immediately after creation: alvr\server\src\hand_gestures.rs#L148
warning: calls to `push` immediately after creation --> alvr\server\src\hand_gestures.rs:148:9 | 148 | / let mut gestures: Vec<HandGesture> = Vec::new(); 149 | | 150 | | // Thumb & index pinch 151 | | gestures.push(HandGesture { ... | 239 | | ), 240 | | }); | |___________^ help: consider using the `vec![]` macro: `let mut gestures: Vec<HandGesture> = vec![..];` | = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#vec_init_then_push = note: `#[warn(clippy::vec_init_then_push)]` on by default
using `Option.and_then(|x| Some(y))`, which is more succinctly expressed as `map(|x| y)`: alvr\server\src\connection.rs#L660
warning: using `Option.and_then(|x| Some(y))`, which is more succinctly expressed as `map(|x| y)` --> alvr\server\src\connection.rs:660:17 | 660 | / config.hand_tracking.use_gestures.as_option().and_then(|_| { 661 | | Some(ButtonMappingManager::new_automatic( 662 | | &HAND_GESTURE_BUTTON_SET, 663 | | &config.button_mapping_config, 664 | | )) 665 | | }) | |__________________^ | = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#bind_instead_of_map = note: `#[warn(clippy::bind_instead_of_map)]` on by default help: try this | 660 ~ config.hand_tracking.use_gestures.as_option().map(|_| ButtonMappingManager::new_automatic( 661 + &HAND_GESTURE_BUTTON_SET, 662 + &config.button_mapping_config, 663 + )) |
variable does not need to be mutable: alvr\launcher\src\main.rs#L759
warning: variable does not need to be mutable --> alvr\launcher\src\main.rs:759:9 | 759 | let mut installation_dir = data_dir().extended(VERSIONS_SUBDIR).extended(&release.tag); | ----^^^^^^^^^^^^^^^^ | | | help: remove this `mut` | = note: `#[warn(unused_mut)]` on by default
unused import: `Permissions`: alvr\launcher\src\main.rs#L6
warning: unused import: `Permissions` --> alvr\launcher\src\main.rs:6:22 | 6 | fs::{self, File, Permissions}, | ^^^^^^^^^^^ | = note: `#[warn(unused_imports)]` on by default
writing `&Vec` instead of `&[_]` involves a new object where a slice will do: alvr/server/src/hand_gestures.rs#L569
warning: writing `&Vec` instead of `&[_]` involves a new object where a slice will do --> alvr/server/src/hand_gestures.rs:569:15 | 569 | gestures: &Vec<HandGesture>, | ^^^^^^^^^^^^^^^^^ help: change this to: `&[HandGesture]` | = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#ptr_arg = note: `#[warn(clippy::ptr_arg)]` on by default
called `unwrap` on `hover_bind` after checking its variant with `is_some`: alvr/server/src/hand_gestures.rs#L594
warning: called `unwrap` on `hover_bind` after checking its variant with `is_some` --> alvr/server/src/hand_gestures.rs:594:17 | 592 | if hover_bind.is_some() { | ----------------------- help: try: `if let Some(..) = hover_bind` 593 | button_mapping_manager.report_button( 594 | hover_bind.unwrap(), | ^^^^^^^^^^^^^^^^^^^ | = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#unnecessary_unwrap
called `unwrap` on `touch_bind` after checking its variant with `is_some`: alvr/server/src/hand_gestures.rs#L585
warning: called `unwrap` on `touch_bind` after checking its variant with `is_some` --> alvr/server/src/hand_gestures.rs:585:17 | 583 | if touch_bind.is_some() { | ----------------------- help: try: `if let Some(..) = touch_bind` 584 | button_mapping_manager.report_button( 585 | touch_bind.unwrap(), | ^^^^^^^^^^^^^^^^^^^ | = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#unnecessary_unwrap
called `unwrap` on `click_bind` after checking its variant with `is_some`: alvr/server/src/hand_gestures.rs#L576
warning: called `unwrap` on `click_bind` after checking its variant with `is_some` --> alvr/server/src/hand_gestures.rs:576:17 | 574 | if click_bind.is_some() { | ----------------------- help: try: `if let Some(..) = click_bind` 575 | button_mapping_manager.report_button( 576 | click_bind.unwrap(), | ^^^^^^^^^^^^^^^^^^^ | = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#unnecessary_unwrap = note: `#[warn(clippy::unnecessary_unwrap)]` on by default
this function has too many arguments (8/7): alvr/server/src/hand_gestures.rs#L480
warning: this function has too many arguments (8/7) --> alvr/server/src/hand_gestures.rs:480:5 | 480 | / fn get_joystick_values( 481 | | &self, 482 | | center: Pose, 483 | | anchor: Pose, ... | 488 | | offset_vert: f32, 489 | | ) -> Vec2 { | |_____________^ | = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#too_many_arguments
usage of `contains_key` followed by `insert` on a `HashMap`: alvr/server/src/hand_gestures.rs#L384
warning: usage of `contains_key` followed by `insert` on a `HashMap` --> alvr/server/src/hand_gestures.rs:384:9 | 384 | / if !gesture_data.contains_key(&gesture_id) { 385 | | gesture_data.insert( 386 | | gesture_id, 387 | | GestureAction { ... | 396 | | ); 397 | | } | |_________^ | = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#map_entry = note: `#[warn(clippy::map_entry)]` on by default help: try this | 384 ~ gesture_data.entry(gesture_id).or_insert(GestureAction { 385 + last_activated: 0, 386 + last_deactivated: 0, 387 + entering: false, 388 + entering_since: 0, 389 + exiting: false, 390 + exiting_since: 0, 391 + active: false, 392 + }); |
this function has too many arguments (11/7): alvr/server/src/hand_gestures.rs#L362
warning: this function has too many arguments (11/7) --> alvr/server/src/hand_gestures.rs:362:5 | 362 | / fn is_gesture_active( 363 | | &mut self, 364 | | gesture_id: HandGestureId, 365 | | first_anchor: Pose, ... | 373 | | device_id: u64, 374 | | ) -> bool { | |_____________^ | = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#too_many_arguments = note: `#[warn(clippy::too_many_arguments)]` on by default
calls to `push` immediately after creation: alvr/server/src/hand_gestures.rs#L148
warning: calls to `push` immediately after creation --> alvr/server/src/hand_gestures.rs:148:9 | 148 | / let mut gestures: Vec<HandGesture> = Vec::new(); 149 | | 150 | | // Thumb & index pinch 151 | | gestures.push(HandGesture { ... | 239 | | ), 240 | | }); | |___________^ help: consider using the `vec![]` macro: `let mut gestures: Vec<HandGesture> = vec![..];` | = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#vec_init_then_push = note: `#[warn(clippy::vec_init_then_push)]` on by default
using `Option.and_then(|x| Some(y))`, which is more succinctly expressed as `map(|x| y)`: alvr/server/src/connection.rs#L660
warning: using `Option.and_then(|x| Some(y))`, which is more succinctly expressed as `map(|x| y)` --> alvr/server/src/connection.rs:660:17 | 660 | / config.hand_tracking.use_gestures.as_option().and_then(|_| { 661 | | Some(ButtonMappingManager::new_automatic( 662 | | &HAND_GESTURE_BUTTON_SET, 663 | | &config.button_mapping_config, 664 | | )) 665 | | }) | |__________________^ | = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#bind_instead_of_map = note: `#[warn(clippy::bind_instead_of_map)]` on by default help: try this | 660 ~ config.hand_tracking.use_gestures.as_option().map(|_| ButtonMappingManager::new_automatic( 661 + &HAND_GESTURE_BUTTON_SET, 662 + &config.button_mapping_config, 663 + )) |