pub trait ToFlexStr {
fn to_flex_str(&self) -> FlexStr;
}Expand description
A trait that converts the source to a FlexStr without consuming it
use flexstr::ToFlexStr;
let a = "This is a heap allocated string!!!!!".to_string().to_flex_str();
assert!(a.is_heap());Required methods
fn to_flex_str(&self) -> FlexStr
fn to_flex_str(&self) -> FlexStr
Converts the source to a FlexStr without consuming it
Implementations on Foreign Types
sourceimpl ToFlexStr for str
impl ToFlexStr for str
sourcefn to_flex_str(&self) -> FlexStr
fn to_flex_str(&self) -> FlexStr
use flexstr::ToFlexStr;
// Don't use for literals - use `into_flex_str` instead
let a = "test".to_flex_str();
assert!(a.is_inlined());