pub trait IntoFlexStr {
    fn into_flex_str(self) -> FlexStr;
}
Expand description

A trait that converts the source to a FlexStr while consuming the original

use flexstr::IntoFlexStr;

let a = "This is a wrapped static string literal no matter how long it is!!!!!".into_flex_str();
assert!(a.is_static());

Required methods

Converts the source to a FlexStr while consuming the original

Implementations on Foreign Types

use flexstr::IntoFlexStr;

let a = "This is a wrapped static string literal no matter how long it is!!!!!".into_flex_str();
assert!(a.is_static());
use flexstr::IntoFlexStr;

let a = "This is a heap allocated string since it is a `String`".to_string().into_flex_str();
assert!(a.is_heap());

Implementors