WIP: Use matches
macro #49
No reviewers
Labels
No labels
Automated
Backlog
Post_Prototype_1.0
Bot_Code
Core
Bot_Code
Custom
CI/CD
Complexity
Advanced
Complexity
Basic
Complexity
Expert
Complexity
Intermediate
Kind/Breaking
Kind/Bug
Kind/Bug Fix
Kind/Documentation
Kind/Enhancement
Kind/Feature
Kind/Security
Kind/Testing
Nix
Ownership
Collab
Ownership
Collab with Leads
Ownership
Individual Lead
Ownership
In-Review
Ownership
Needs Owner > May Delegate
Ownership
Workshop with Leads
Phase 1.0
Requirements > Drafting
Phase 1.0
Requirements > Researching
Phase 1.0
Requirements > Review & Planning
Phase 2.0
Design > Research & Analysis
Phase 3.0
Coding > Implementation
Phase 4.0
QA > Unit Testing & Design
Phase 5.0
Resolution > Completed
Phase 5.0
Resolution > Review for Completion
Priority
Critical
Priority
High
Priority
Low
Priority
Medium
Reviewed
Confirmed
Reviewed
Duplicate
Reviewed
Invalid
Reviewed
Won't Fix
Status
Abandoned
Status
Blocked
Status
Need More Info
No milestone
No project
No assignees
1 participant
Notifications
Due date
Dependencies
No dependencies set.
Reference: modulatingforce/forcebot_rs#49
Loading…
Reference in a new issue
No description provided.
Delete branch "use-matches"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
In Logical Code areas where we're validating an
enum
for it's variant without really caring about the value, we should use thematches!()
macrohttps://doc.rust-lang.org/std/macro.matches.html
There's definitely areas where this is needed
I know for certain, for example, there's areas that validate Required Roles variants, but don't care about the value
Just to note, I'm not sure if this will work in every case. I discovered that my original matches logic involving filters on iterators and using match was not matching in the way I expected it (though my original expectations were incorrect)
For these conditions, I seem to have needed to use a for loop and match, like the below in for routines
I mean it would be nicer if I could fit everything in one line, but looking at the above seems relatively clean at a glance logically, so I think I prefer the
match!
uses similar to the aboveReally need to double check if this is required or not , and then flesh out the requirements more before considering delegating
LULE honestly thought this would be quick, hence the PR.
Abandoning . Really low priority if an issue, and not really impacting if we enforce in existing code. I've been using this macro though for newer code
I think I wanted to demo this macro, but I have since discovered so many more macros and crates that are also worth showcasing
If we require any Showcasing , I think best path is to :
Demonstration
(a label maybe?)Pull request closed