You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
The current wrap method allocates completely new strings for each line. This is necessary is one wants to support automatic hyphenation since the output can be different from the input in that case.
However, for the simple case with no hyphenation, it should be possible to return Vec<&str> where each &str is a slice of the original input string. This would mean fewer allocations and no copying of data, which ought to be faster.
The text was updated successfully, but these errors were encountered:
The current
wrap
method allocates completely new strings for each line. This is necessary is one wants to support automatic hyphenation since the output can be different from the input in that case.However, for the simple case with no hyphenation, it should be possible to return
Vec<&str>
where each&str
is a slice of the original input string. This would mean fewer allocations and no copying of data, which ought to be faster.The text was updated successfully, but these errors were encountered: