#string #cursed #type #ops #deref #annoyed

nightly cursed_strings

Annoyed that Rust has two string types? Well it doesn't any more

2 releases

0.1.1 Aug 25, 2021
0.1.0 Aug 24, 2021

#2017 in Rust patterns

31 downloads per month

MIT license

10KB
241 lines

The one and only string type in Rust

let foo: &str = "foo".into();
let expected: &str = "foobar".into();

let mut foobar = foo.to_owned();
foobar.push_str("bar".into());

assert_eq!(foobar.deref(), expected);

No runtime deps