string
string copied to clipboard
Add `slice_ref` to `String<Bytes>`
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
.