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

Converts the source to a FlexStr without consuming it

Implementations on Foreign Types

use flexstr::ToFlexStr;

// Don't use for literals - use `into_flex_str` instead
let a = "test".to_flex_str();
assert!(a.is_inlined());

Implementors