Skip to main content

ToSmolStr

Trait ToSmolStr 

Source
pub trait ToSmolStr {
    // Required method
    fn to_smolstr(&self) -> SmolStr;
}
Expand description

Convert value to SmolStr using fmt::Display, potentially without allocating.

Almost identical to ToString, but converts to SmolStr instead.

Required Methods§

Dyn Compatibility§

This trait is dyn compatible.

In older versions of Rust, dyn compatibility was called "object safety".

Implementors§

Source§

impl<T> ToSmolStr for T
where T: Display + ?Sized,