Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Split graphemes and grapheme_indices into two methods#31

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 ourterms of service andprivacy statement. We’ll occasionally send you account related emails.

Already on GitHub?Sign in to your account

Open
LunaBorowska wants to merge1 commit intounicode-rs:master
base:master
Choose a base branch
Loading
fromLunaBorowska:separate-grapheme-methods

Conversation

LunaBorowska
Copy link

s.extended_graphemes() is more readable thans.graphemes(true), as you don't have to think what does true mean here. Those methods were implemented as default methods in order to preserve backward compatibility if somebody implementedUnicodeSegmentation for their own types.

This is a feature, so second number in semantic version should be increased.

s.extended_graphemes() is more readable than s.graphemes(true), asyou don't have to think what does true mean here. Those methods wereimplemented as default methods in order to preserve backwardcompatibility if somebody implemented UnicodeSegmentation for theirown types.
@Manishearth
Copy link
Member

i kinda think making itextended_graphemes() will make people use it less. (perhaps make the false case legacy_graphemes?)

@tapeinosyne
Copy link

@Manishearth
i kinda think making it extended_graphemes() will make people use it less. (perhaps make the false case legacy_graphemes?)

A preference forlegacy_graphemes is apparent in#22 as well.

@LunaBorowska
Copy link
Author

LunaBorowska commentedOct 14, 2017
edited
Loading

Oh, there was already an issue about this in issue tracker. Somehow missed that.

Unfortunately it's not really possible to have optional parameters in Rust, so changinggraphemes(true) intographemes() would be a breaking change. Definitely a good choice for unicode-segmentation 2.0.0 however.

But now that I think about it... I think it's feasible to have a trait with a different name which exportsgraphemes() method. This could be however confusing and UnicodeSegmentation is a good name, so it's probably not a good choice.

Sign up for freeto join this conversation on GitHub. Already have an account?Sign in to comment
Reviewers
No reviews
Assignees
No one assigned
Labels
None yet
Projects
None yet
Milestone
No milestone
Development

Successfully merging this pull request may close these issues.

3 participants
@LunaBorowska@Manishearth@tapeinosyne

[8]ページ先頭

©2009-2025 Movatter.jp