string icon indicating copy to clipboard operation
string copied to clipboard

Add `slice_ref` to `String<Bytes>`

Open argv-minus-one opened this issue 2 years ago • 0 comments

This PR adds a slice_ref method to String<Bytes>, which does the same thing as Bytes::slice_ref.

I expect this will be useful for parsing: take a big string as String<Bytes>, parse it into a bunch of &str slices, then convert them all back into independent String<Bytes> instances without allocating or copying, using slice_ref.

argv-minus-one avatar Jan 23 '22 22:01 argv-minus-one