-
Notifications
You must be signed in to change notification settings - Fork 411
fix(rustup): installed toolchains for legacy rustup #1683
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(rustup): installed toolchains for legacy rustup #1683
Conversation
066ab7c
to
1ea2fd5
Compare
src/rustup.rs
Outdated
// Emulate --quiet by removing suffixes like " (active, default)" or " (override)" manually | ||
Ok(out | ||
.lines() | ||
.map(|l| SUFFIX_REGEX.replace(l.trim(), "").into_owned()) |
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.
Regex is not needed for this.
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.
How? 🤔
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.
.map(|l| l.split_once(" (").map(|(a, _)| a).unwrap_or(l))
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.
or what you did with split, I just have a habit of using split_once when I really only need one split :D
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.
Let me know if it can be improved further.
Can you squash yourself upon merge or should I do it manually?
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.
Please squash the commits and we can merge. If possible I'd like a test for this also, but no stress we can fo that later
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 couldn't find any tests for rustup.rs and I know that you don't like new crates like visibility to allow doctests...
#1684
bf62f44
to
db297cb
Compare
db297cb
to
3e09576
Compare
Fixes #1678
Unfortunately some installations use legacy versions, my previous fix was only working for the current rustup >= 1.28.0.