-
Notifications
You must be signed in to change notification settings - Fork 13.3k
A handful of random string-related improvements #54932
New issue
Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? # to your account
A handful of random string-related improvements #54932
Conversation
(rust_highfive has picked a reviewer for you, use r? to override) |
Thanks! |
src/build_helper/lib.rs
Outdated
@@ -91,13 +92,13 @@ pub fn try_run_suppressed(cmd: &mut Command) -> bool { | |||
output.status.success() | |||
} | |||
|
|||
pub fn gnu_target(target: &str) -> String { | |||
pub fn gnu_target(target: &str) -> Cow<str> { |
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.
This can just be &str I believe without the need for cow. This isn't ever really hot code anyway
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.
Oh yeah, silly me; fixed. The code is not hot for sure, but I don't mind improving it anyway ^^.
0821630
to
a01a994
Compare
@bors: r+ |
📌 Commit a01a994 has been approved by |
…ents, r=alexcrichton A handful of random string-related improvements - remove a few allocations in `errors/diagnostic` - make `build_helper::gnu_target` return `Cow<str>`
…ents, r=alexcrichton A handful of random string-related improvements - remove a few allocations in `errors/diagnostic` - make `build_helper::gnu_target` return `Cow<str>`
Rollup of 16 pull requests Successful merges: - #54755 (Documents reference equality by address (#54197)) - #54811 (During rustc bootstrap, make default for `optimize` independent of `debug`) - #54825 (NLL says "borrowed content" instead of more precise "dereference of raw pointer") - #54860 (Add doc comments about safest way to initialize a vector of zeros) - #54869 (Fix mobile docs) - #54891 (Fix tracking issue for Once::is_completed) - #54913 (doc fix: it's auto traits that make for automatic implementations) - #54920 (Fix handling of #[must_use] on unit and uninhabited types) - #54932 (A handful of random string-related improvements) - #54936 (impl Eq+Hash for TyLayout) - #54950 (std: Synchronize global allocator on wasm32) - #54956 ("(using ..." doesn't have the matching ")") - #54958 (add a macro for static (compile-time) assertions) - #54967 (Remove incorrect span for second label inner macro invocation) - #54983 (Fix slice's benchmarks) - #54989 (Fix spelling in the documentation to htmldocck.py) Failed merges: r? @ghost
errors/diagnostic
build_helper::gnu_target
returnCow<str>