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
Should behave like String::truncate, ie panic if new_len not on a char boundary. The "same" implementation should work too, although I was expecting DynamicVec::truncate to move from Spilled to Inline if new_len <= 15 but it doesn't seem to do that. I can try making a PR for one or both of these things if they sound like improvements.
The text was updated successfully, but these errors were encountered:
I was expecting DynamicVec::truncate to move from Spilled to Inline if new_len <= 15 but it doesn't seem to do that.
It doesn't do that because you might go above and below the limit frequently and then it would have a ton of allocations. Works the same way in smallvec.
I'm open for a PR that adds a EcoString::truncate behaving just like std's.
Should behave like
String::truncate
, ie panic ifnew_len
not on a char boundary. The "same" implementation should work too, although I was expectingDynamicVec::truncate
to move fromSpilled
toInline
ifnew_len <= 15
but it doesn't seem to do that. I can try making a PR for one or both of these things if they sound like improvements.The text was updated successfully, but these errors were encountered: