-
Notifications
You must be signed in to change notification settings - Fork 15
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
fixed issue #18 #43
fixed issue #18 #43
Conversation
plastic_tui/src/ui.rs
Outdated
@@ -451,14 +451,19 @@ impl Ui { | |||
|
|||
fn handle_gamepad(&mut self) { | |||
// set events in the cache and check if gamepad is still active | |||
while let Some(GilrsEvent { id, event, .. }) = self.gilrs.next_event() { | |||
if self.gilrs.is_none() { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
A small improvement here,
you can use
// didn't test the code, but the idea here
let Some(mut gilrs) = self.gilrs else {
return;
};
then afterwards, you can use girls
without the need for as_mut().unwrap()
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks for the suggestion, will implement
EDIT: Unforuntly, the girls
object does not implement copy, so it cant be moved out of the Some variant. Good idea nonetheless.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
You can use ref
Also please run |
Fixed all of the issues. |
and assigning it to a varible
Codecov ReportAll modified and coverable lines are covered by tests ✅
Additional details and impacted files@@ Coverage Diff @@
## master #43 +/- ##
=======================================
Coverage 81.81% 81.81%
=======================================
Files 37 37
Lines 5352 5352
=======================================
Hits 4379 4379
Misses 973 973 ☔ View full report in Codecov by Sentry. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks for this. Great
changed the controller to an option