feat(orb-mcu-util): print new diamond evt version#381
Merged
Conversation
d750940 to
6b84d83
Compare
Qbicz
approved these changes
Feb 19, 2025
mcu-util/src/orb/revision.rs
Outdated
Member
There was a problem hiding this comment.
Suggested change
| write!(f, "EVT{:?}", self.0.version) | |
| write!(f, "Pearl EV{:?}", self.0.version) |
I'd prefer verbose unless any tools depend on it
Collaborator
Author
There was a problem hiding this comment.
i would prefer too but indeed, this would break things
also print 'Diamond_unknown' in case binary doesn't support any new version
6b84d83 to
dec8a5e
Compare
TheButlah
approved these changes
Feb 19, 2025
| fn from_version_i32(value: i32) -> Self; | ||
| } | ||
| impl OrbVersionFromInt for orb_messages::hardware::OrbVersion { | ||
| fn from_version_i32(value: i32) -> Self { |
Collaborator
There was a problem hiding this comment.
Suggested change
| fn from_version_i32(value: i32) -> Self { | |
| const fn from_version_i32(value: i32) -> Self { |
Collaborator
Author
There was a problem hiding this comment.
interesting... is this const a new thing?
what does it bring?
Collaborator
There was a problem hiding this comment.
its like constexpr in c++ - evaluation is done at compile-time. Const functions have been around for a long time (possibly since 1.0?). But they are more useful nowadays, and especially after the inline_const feature was stabilized last year: rust-lang/rust#104087.
const mostly gets used in places where assignment to a const or a static variable is necessary.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
also print 'Diamond_unknown' in case binary doesn't support any new version