Skip to main content

StringIfEmpty

Trait StringIfEmpty 

Source
pub trait StringIfEmpty<X: ToString> {
    // Required method
    fn string_if_empty(&self, empty_string: X) -> String;
}
Expand description

Substitute a placeholder for an empty string.

Required Methods§

Source

fn string_if_empty(&self, empty_string: X) -> String

Return empty_string if this is empty, otherwise the value itself.

Dyn Compatibility§

This trait is dyn compatible.

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

Implementors§

Source§

impl<S: AsRef<str>, X: ToString> StringIfEmpty<X> for S