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

Adding missing size_hint for UnicodeSentences, UnicodeWords, and UnicodeWordIndices#128

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

Merged
Manishearth merged 1 commit intounicode-rs:masterfromryanavella:master
Dec 24, 2023

Conversation

ryanavella
Copy link
Contributor

@ryanavellaryanavella commentedDec 24, 2023
edited
Loading

I don't expect this to noticeably impact performance either positively or negatively for most use-cases, especially becauseIterator::collect relies on the lower bound ofsize_hint which will remain unchanged after this PR.

However the upper bound will go fromNone toSome(upper), which may benefit downstream crates that use it as a heuristic for pre-allocation size.

Note also that I forwarded the implementation ofsize_hint to the inner iterator, which means it is UAX#29 agnostic. I'm not enough of a Unicode expert to know if e.g. word boundaries can be empty, so it may not be the tightest possible upper bound for longer strings.

@ManishearthManishearth merged commit062c264 intounicode-rs:masterDec 24, 2023
Sign up for freeto join this conversation on GitHub. Already have an account?Sign in to comment
Reviewers

@ManishearthManishearthManishearth approved these changes

Assignees
No one assigned
Labels
None yet
Projects
None yet
Milestone
No milestone
Development

Successfully merging this pull request may close these issues.

2 participants
@ryanavella@Manishearth

[8]ページ先頭

©2009-2025 Movatter.jp