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

Refactor filesystem_watcher_system with let-else #7545

Closed
wants to merge 1 commit into from

Conversation

nicopap
Copy link
Contributor

@nicopap nicopap commented Feb 7, 2023

Objective

filesystem_watcher_system previously used if let in
a way that could be cleanly replaced by let else.

Inside the loop, there were a match followed by a if let
that could be merged together.

Solution

Use let else and merge the match and if let

@nicopap nicopap added A-Assets Load files from disk to use for things like images, models, and sounds C-Code-Quality A section of code that is hard to understand or change labels Feb 7, 2023
@nicopap nicopap force-pushed the tinny-let-else-assets branch from 286782c to 6177704 Compare February 7, 2023 10:15
@rparrett
Copy link
Contributor

rparrett commented Feb 7, 2023

Related: #7104

It looks like rustfmt still doesn't support let else.

@nicopap
Copy link
Contributor Author

nicopap commented Feb 7, 2023

Oooh, I thought #7104 was merged already and this was an oversight. Hmm, not sure if I should keep this open

@nicopap nicopap closed this Mar 2, 2023
@nicopap nicopap deleted the tinny-let-else-assets branch August 30, 2023 13:46
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
A-Assets Load files from disk to use for things like images, models, and sounds C-Code-Quality A section of code that is hard to understand or change
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants