-
Notifications
You must be signed in to change notification settings - Fork 893
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
Use serde to encode/decode various TOML formats #3864
Conversation
c1838e7
to
686defa
Compare
src/config.rs
Outdated
Ok(()) | ||
}) | ||
} | ||
_ => Err(RustupError::UnknownMetadataVersion(current_version).into()), | ||
MetadataVersion::V12 => { |
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.
To me it's clear that the happy path in the original code is for MetadataVersion::default()
, but now it's for MetadataVersion::V12
. I know at the moment being it's all the same, but the meaning being conveyed seems to be a bit different, and that might cause problems when the default value changes 🤔
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.
I've reverted the logic to something closer to what was originally there.
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.
Nice improvements overall! Somehow I thought we were using serde
for such things already 🤣
This saves a bunch of code (-190 lines) and is generally more idiomatic. It also saves about 8% of latency on proxy invocations, after (both best of 3 runs):
before: