pub trait IntoLocalStr {
// Required method
fn into_local_str(self) -> LocalStr;
}
Expand description
A trait that converts the source to a LocalStr while consuming the original
use flexstr::local_str;
let a = local_str!("This is a wrapped static string literal no matter how long it is!!!!!");
assert!(a.is_static());
Required Methods§
Sourcefn into_local_str(self) -> LocalStr
fn into_local_str(self) -> LocalStr
Converts the source to a LocalStr while consuming the original
Implementations on Foreign Types§
Source§impl IntoLocalStr for String
impl IntoLocalStr for String
Source§fn into_local_str(self) -> LocalStr
fn into_local_str(self) -> LocalStr
use flexstr::IntoLocalStr;
let a = "This is a heap allocated string since it is a `String`".to_string().into_local_str();
assert!(a.is_heap());