-
Notifications
You must be signed in to change notification settings - Fork 9
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
fix: make Transform enum non-exhaustive #194
Conversation
Happily, cargo-semver-checks caught the addition of some variants in #185, but it's a shame that had to be a minor bump. This marks the enum as non-exhaustive so future transform additions won't necessarily be considered breaking changes. It's unlikely users will ever have to match on this anyway so this shouldn't cause any problems (it could probably be a struct with an 'inner' enum, really).
WalkthroughThe pull request introduces significant changes to the Changes
Possibly related PRs
Poem
Thank you for using CodeRabbit. We offer it for free to the OSS community and would appreciate your support in helping us grow. If you find it useful, would you consider giving us a shout-out on your favorite social media? 🪧 TipsChatThere are 3 ways to chat with CodeRabbit:
Note: Be mindful of the bot's finite context window. It's strongly recommended to break down tasks such as reading entire modules into smaller chunks. For a focused discussion, use review comments to chat about specific files and their changes, instead of using the PR comments. CodeRabbit Commands (Invoked using PR comments)
Other keywords and placeholders
CodeRabbit Configuration File (
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Actionable comments posted: 0
🧹 Outside diff range and nitpick comments (1)
crates/augurs-forecaster/src/transforms.rs (1)
47-47
: LGTM! Good use of #[non_exhaustive] attribute.Making the Transform enum non-exhaustive is a good design choice as it:
- Allows adding new transformation types without breaking changes
- Maintains API flexibility for future extensions
Consider documenting this design decision in the enum's documentation to inform users about the intentional non-exhaustiveness and guide them on handling unknown variants.
📜 Review details
Configuration used: CodeRabbit UI
Review profile: CHILL
📒 Files selected for processing (1)
crates/augurs-forecaster/src/transforms.rs
(1 hunks)
🔇 Additional comments (1)
crates/augurs-forecaster/src/transforms.rs (1)
Line range hint 1-1000
: Implementation is robust and well-tested.
The transformation implementations demonstrate:
- Comprehensive error handling
- Thorough test coverage
- Consistent API design
Happily, cargo-semver-checks caught the addition of some variants
in #185, but it's a shame that had to be a minor bump. This marks
the enum as non-exhaustive so future transform additions won't
necessarily be considered breaking changes. It's unlikely users
will ever have to match on this anyway so this shouldn't cause
any problems (it could probably be a struct with an 'inner'
enum, really).
Summary by CodeRabbit
Transform
enum to allow for future extensions without breaking existing implementations.power_transform
method for better robustness during transformation processes.