pub trait ExpandTabs<'a> {
// Required method
fn expand_tabs(self, spaces: usize) -> Cow<'a, str>;
}Available on crate feature
alloc only.Expand description
To extend str and Cow<str> to have expand_tabs method.
This replaces each tab with a fixed number of spaces and does not align to tab stops.
Required Methods§
Sourcefn expand_tabs(self, spaces: usize) -> Cow<'a, str>
fn expand_tabs(self, spaces: usize) -> Cow<'a, str>
Returns a Cow<str> where each tab is replaced with spaces spaces.
Passing 0 removes tabs.
Dyn Compatibility§
This trait is dyn compatible.
In older versions of Rust, dyn compatibility was called "object safety".