Closed arifd closed 7 months ago
Could maybe return an Option<Cow<'_, Cow<'x, str>>> Which looks a little crazy to me tbh, but i'm told: It prevents the need to clone the String if it's not needed
Not sure what they meant by that. Cow is used in the code specifically to avoid allocating memory when it is not needed.
Some places take in
&'x self
when they shouldn't.The functions returning iterators, probably need two lifetimes, so that they don't bind the lifetime associated with the input buffer, to self.
But I need a bit more time to play with the code.
Discussion in the discord forums is telling me that some functions, like this one:
Could maybe return an
Option<Cow<'_, Cow<'x, str>>>
Which looks a little crazy to me tbh, but i'm told: