#![cfg_attr(feature = "document-features", doc = document_features::document_features!())]
#![cfg_attr(not(feature = "unsafe"), forbid(unsafe_code))]
#![cfg_attr(docsrs, feature(doc_auto_cfg))]
#[cfg(not(feature = "std"))]
compile_error!("`std` feature is required; reserved for future `no_std` support");
mod stack;
mod string;
mod string_cow;
mod string_ref;
pub mod backend;
pub use stack::StackString;
pub use string::*;
pub use string_cow::*;
pub use string_ref::*;
#[cfg(test)]
mod test {
#[test]
fn test_size() {
println!(
"String: {}",
std::mem::size_of::<crate::string::StdString>()
);
println!(
"Box<str>: {}",
std::mem::size_of::<crate::backend::DefaultStr>()
);
println!(
"Box<Box<str>>: {}",
std::mem::size_of::<Box<crate::backend::DefaultStr>>()
);
println!("str: {}", std::mem::size_of::<&'static str>());
println!(
"Cow: {}",
std::mem::size_of::<std::borrow::Cow<'static, str>>()
);
}
}