string
string copied to clipboard
Rust String type with configurable byte storage.
It's fairly simple and you can reference to [bytestring impl](https://docs.rs/bytestring/1.3.0/src/bytestring/lib.rs.html#253-291).
The previous `from_str` require T meets `From + StableAsRef, {} ``` For example, the `Bytes` only implements from `&'static [u8]` and `&'static str`. In the previous `String::from_str` impl, it's impossible...
This PR implements `From` for `String`, which otherwise requires `unsafe`. No conversion is added for `String` because there is no implementation of `From` or `From` for `BytesMut`, as there is...
This PR adds a `slice_ref` method to `String`, which does the same thing as [`Bytes::slice_ref`](https://docs.rs/bytes/latest/bytes/struct.Bytes.html#method.slice_ref). I expect this will be useful for parsing: take a big string as `String`, parse...
This change uses const generics and increases the MSRV to [1.51.0], which was released 7 months ago. [1.51.0]:
The [documentation of `Borrow`][borrow] says that `Eq`, `Ord` and `Hash` implementation of a type which implements `Borrow` must behave identical to `T`. On the other hand, `String` implements those traits...
Hi! As of current status `&str` can't be used as buffer for `String`. `StableAsRef` implemented for `str`, but not implemented for `&str` due to implicit `Sized` bound in `unsafe impl