I don't expect this to noticeably impact performance either positively or negatively for most use-cases, especially because Iterator::collect relies on the lower bound of size_hint which will remain unchanged after this PR.
However the upper bound will go from None to Some(upper), which may benefit downstream crates that use it as a heuristic for pre-allocation size.
Note also that I forwarded the implementation of size_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.
I don't expect this to noticeably impact performance either positively or negatively for most use-cases, especially because
Iterator::collect
relies on the lower bound ofsize_hint
which will remain unchanged after this PR.However the upper bound will go from
None
toSome(upper)
, which may benefit downstream crates that use it as a heuristic for pre-allocation size.Note also that I forwarded the implementation of
size_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.