-
Notifications
You must be signed in to change notification settings - Fork 12.8k
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
Updating str.chars docs to mention crates.io. #68495
Conversation
This might spare someone else a little time searching the stdlib for unicode/grapheme support.
Thanks for the pull request, and welcome! The Rust team is excited to review your changes, and you should hear from @sfackler (or someone else) soon. If any changes to this PR are deemed necessary, please add them as extra commits. This ensures that the reviewer can see what has changed since they last reviewed the code. Due to the way GitHub handles out-of-date commits, this should also make it reasonably obvious what issues have or haven't been addressed. Large or tricky changes may require several passes of review and changes. Please see the contribution instructions for more information. |
Thanks for the info robot. |
We generally don't write docs like this; I will let @rust-lang/libs decide if they want this or not, however. |
(For slightly more context, negative statements in docs tend to go out of date quickly; if we did add this functionality, this comment would very likely get out of date. Additionally, we don't generally pick favorites, and so mentioning crates.io by name is also unusual.) |
The only reason I even made this PR was after reading the whole thread at https://users.rust-lang.org/t/how-do-you-iterate-over-grapheme-clusters-of-a-string-in-rust/11338/3 |
Up to you guys, I have no preference. Just tried to spare someone else a little lost time. |
I'm in favor of adding this information. I wouldn't even mind mentioning the
While I agree that we shouldn't pick favorites, I think it's ok to mention crates as examples. Also, the documentation of std already mentions
I don't think that is a problem in this case. If grapheme cluster iteration would be added, the docs of |
@sfackler @steveklabnik you fine with this? |
I would propose that we update the note as @LukasKalbertodt suggested, including the unicode-segmentation crate. However, it may make sense to ask @BurntSushi - who I feel like probably knows the most about this, though I'm not sure why I think that :) - what they think about this too. r? @BurntSushi |
@Mark-Simulacrum I'm not quite sure I know the most about segmentation, but I have some experience with it. In particular, the But I think this probably deserves a more formal policy decision from the libs team. I don't know if this PR is the right place to put it. If I put my Rust user hat on, then yes, I would very much like to see crate recommendations in And yes, I do see that we do have specific crate recommendations in a few spots already. IMO, we should not jump so quickly to consider these as solid precedent for continuing to mention crates in documentation. It's much more likely that the existing recommendations slipped in because they escaped review. Which is understandable, because it's very easy to see such things as an unquestionably good idea. Anyway, I guess my bottom line is that I'm not necessarily opposed to blessing specific crates in official docs, but rather, think it should be a decision made via a more explicit discussion. I'm not sure if it rises to the level of an RFC though. I am okay with mentioning crates.io in official docs though. |
Hm, okay, I had thought that there was pretty much only one option in the ecosystem, but it sounds like that's not the case (and I guess in any case that would likely get rapidly stale). I agree that trying to decide whether (and how) to incorporate crates.io "recommendations" should not be made here. I'm also not sure if it rises to the level of an RFC, but I think that is probably the right way to go -- at least, I don't know of any other mechanism we have in between. I don't personally think FCP would be appropriate here due to the weight of this specific issue. Given that this PR's current state is just indicating that the functionality is available on crates.io, without mentioning a specific crate, let's merge that in. If folks are interested in further discussing this change, then I think a pre-RFC and so forth is probably the way to go... or at least, is a good start. @bors r+
I guess one other alternative is to mention the cookbook in the string documentation (https://rust-lang-nursery.github.io/rust-cookbook/text.html) and link to that more generally. I'm not sure how well maintained it is these days though. |
📌 Commit ac19dff has been approved by |
Updating str.chars docs to mention crates.io. This might spare someone else a little time searching the stdlib for unicode/grapheme support.
⌛ Testing commit ac19dff with merge a0af395d7ab45de7e964eb8eb76062988a137a38... |
Updating str.chars docs to mention crates.io. This might spare someone else a little time searching the stdlib for unicode/grapheme support.
@bors retry rolled up |
Updating str.chars docs to mention crates.io. This might spare someone else a little time searching the stdlib for unicode/grapheme support.
@bors rollup=always |
Updating str.chars docs to mention crates.io. This might spare someone else a little time searching the stdlib for unicode/grapheme support.
Rollup of 6 pull requests Successful merges: - #68495 (Updating str.chars docs to mention crates.io.) - #68701 (Improve #Safety of various methods in core::ptr) - #69158 (Don't print block exit state in dataflow graphviz if unchanged) - #69179 (Rename `FunctionRetTy` to `FnRetTy`) - #69186 ([tiny] parser: `macro_rules` is a weak keyword) - #69188 (Clean up E0309 explanation) Failed merges: r? @ghost
This might spare someone else a little time searching the stdlib for unicode/grapheme support.