WIP: Case Insensitive Objects #38
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
No due date set.
Dependencies
No dependencies set.
Reference: modulatingforce/forcebot_rs#38
Loading…
Reference in a new issue
No description provided.
Delete branch "case-insensitive-objects"
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 various area of code, I'm constantly having to remember to add
.to_lowercase()
because there's a known implied equality with those types. For exampleBotModule(name1)
andBotModule(name2)
are exactly the same if name1 = "Hello" and name2 = "hello"Better would be to implement PartialEq and Eq traits for basic objects
Below is an example that seems to work in a different branch at the moment for
BotModule
Plan of Action
Chatter(String)
to_lowercase()
Not a HIGH priority , but doing this will help remove the weight of needing to consider case sensitive names when code involves comparing for equality with these types (including in HashMap related methods)
Example Working implementation on playground
https://play.rust-lang.org/?version=stable&mode=debug&edition=2021&gist=6b0211f56600adaab255424f8595ddaa
Related trait documentation
https://doc.rust-lang.org/std/cmp/trait.Eq.html
View command line instructions
Checkout
From your project repository, check out a new branch and test the changes.