Uh oh!
There was an error while loading. Please reload this page.
impl FromIterator<char> for Box<str> - #70094
Conversation
rust-highfive
commented
Mar 18, 2020
(rust_highfive has picked a reviewer for you, use r? to override) |
73ea386 to
5500fcdCompare
LukasKalbertodt
left a comment
There was a problem hiding this comment.
This seems like a reasonable addition to me. Thanks!
Please add four tests for the other four impls. And see my inline comment on the test.
Uh oh!
There was an error while loading. Please reload this page.
These are analogous to impl FromIterator<A> for Box<[A]> (rust-lang#55843). Fixesrust-lang#65163. Signed-off-by: Anders Kaseorg <andersk@mit.edu>
26e3e08 to
e355419Compareandersk
commented
Mar 18, 2020
Sure, now all five |
This PR adds the following stable impls:
All these impls already exist for As I cannot start FCP merges, reassigning. |
LukasKalbertodt
commented
Mar 18, 2020
r? @Amanieu |
andersk
commented
Mar 18, 2020
Note: I saw in #40028 that @withoutboats regretted that the five |
Centril
commented
Mar 18, 2020
You should send in a PR to https://github.com/rust-lang/team to fix that btw. :) |
Amanieu
commented
Mar 18, 2020
@rfcbot fcp merge |
Team member @Amanieu has proposed to merge this. The next step is review by the rest of the tagged team members: Concerns:
Once a majority of reviewers approve (and at most 2 approvals are outstanding), this will enter its final comment period. If you spot a major issue that hasn't been raised at any point in this process, please speak up! See this document for info about what commands tagged team members can give me. |
I am not enthusiastic about this addition. I would prefer not to go any more in the direction of making Box<str> a fully fledged string type. I see it as a niche alternative representation for owned strings for use cases in which 2 words of size instead of 3 words matters for memory usage, such as a big intern table. In general I'd like users to reach for String when operating with owned strings, and use into_boxed_str if their use case demands the representation of a boxed str. I'm fine with the necessary APIs for Box<str> as a niche string representation, including things like From<String> and Default. I'm less fine with growing more string-related surface area around Box<str> than that, like FromIterator, Extend, Add, etc. If someone wants to collect into an owned string and use Box<str> as the representation, I think it's fine to have them write @rfcbot concern is Box<str> a string or a niche string representation |
bors
commented
Apr 2, 2020
☔ The latest upstream changes (presumably #70362) made this pull request unmergeable. Please resolve the merge conflicts. |
dtolnay
commented
Apr 3, 2020
I don't know whether procedurally I should fcp close, but I see a 👍 on #70094 (comment) from Lukas who originally proposed the fcp and it doesn't seem like people are planning to make the opposite case so I'll go ahead and directly close the PR. We can reopen as needed if someone is interested in sticking up for the opposite point of view. Thanks anyway @andersk! |
This is analogous to
impl FromIterator<A> for Box<[A]>(#55843).Fixes#65163.