-
Notifications
You must be signed in to change notification settings - Fork 2.6k
Revert serialization of features to string type #5292
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
Conversation
S: Serializer, | ||
{ | ||
use self::FeatureValue::*; | ||
match *self { |
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.
shorter, but less performance code is: serializer.serialize_str(*self.to_string())
. But this works too.
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.
Yeah -- it's only 7 low-complexity extra lines to avoid the allocations on the common path. I figured it was worth it.
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.
Ok, then this looks good to me. 👍
@bors: r+ Thanks for the quick fix! |
📌 Commit 540bd45 has been approved by |
☀️ Test successful - status-appveyor, status-travis |
Accidentally broken during #5270 and only noticed after merge.
cc @matklad @Eh2406