A UTF-8 encoded string with configurable byte storage.
To use string
, first add this to your Cargo.toml
:
toml
[dependencies]
string = "0.1.3"
Next, add this to your crate:
```rust extern crate string;
use string::{String, TryFrom};
let s: String<[u8; 2]> = String::tryfrom([b'h', b'i']).unwrap(); asserteq!(&s[..], "hi"); ```
See documentation for more details.