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

fixed issue #18 #43

Merged
merged 4 commits into from
Nov 5, 2024
Merged

fixed issue #18 #43

merged 4 commits into from
Nov 5, 2024

Conversation

inyourface34456
Copy link
Contributor

changed the controller to an option

@@ -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() {
Copy link
Owner

@Amjad50 Amjad50 Nov 5, 2024

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()

Copy link
Contributor Author

@inyourface34456 inyourface34456 Nov 5, 2024

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.

Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

You can use ref

@Amjad50
Copy link
Owner

Amjad50 commented Nov 5, 2024

Also please run cargo fmt before the next commit, looks like its failing the CI.
Also check cargo clippy

@inyourface34456
Copy link
Contributor Author

Also please run cargo fmt before the next commit, looks like its failing the CI. Also check cargo clippy

Fixed all of the issues.

Copy link

codecov bot commented Nov 5, 2024

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 81.81%. Comparing base (f254082) to head (eb5633d).
Report is 1 commits behind head on master.

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.
📢 Have feedback on the report? Share it here.

Copy link
Owner

@Amjad50 Amjad50 left a 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

@Amjad50 Amjad50 merged commit 24f3747 into Amjad50:master Nov 5, 2024
4 checks passed
@Amjad50 Amjad50 mentioned this pull request Nov 5, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants