pub trait IntoAFlexStr {
    fn into_a_flex_str(self) -> AFlexStr;
}
Expand description

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

use flexstr::IntoAFlexStr;

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

Required methods

Converts the source to an AFlexStr while consuming the original

Implementations on Foreign Types

use flexstr::IntoAFlexStr;

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

let a = "This is a heap allocated string since it is a `String`".to_string().into_a_flex_str();
assert!(a.is_heap());
use flexstr::IntoAFlexStr;

let a = 't'.into_a_flex_str();
assert!(a.is_inlined());
assert_eq!(a, "t");

Implementors