Open lithbitren opened 1 year ago
or give cow<str>
a new name and let it be like a CowString
, so that we can use it like:
let abc = CowString::from("abc");
let empty = "".to_cow_string();
let abc_empty = abc + empty;
assert!(abc_empty.is_borrowed());
let upper = abc_empty.to_uppercase();
assert_eq!("ABC", upper);
let upper_upper = upper.to_uppercase();
assert!(upper_upper.is_borrowed());
just like:
std::borrow::Cow
check that Cow<'a, str> implements addition