pub trait TrimLine: Sized {
// Required methods
fn trim_line(self) -> Self;
fn trim_line_start(self) -> Self;
fn trim_line_end(self) -> Self;
}Expand description
To extend str and Cow<str> with methods that trim empty lines.
Lines are separated only by LF (\n), and a line is empty when all of its characters are Unicode whitespace.
Required Methods§
Sourcefn trim_line_start(self) -> Self
fn trim_line_start(self) -> Self
Trims empty lines from the start of the string.
Sourcefn trim_line_end(self) -> Self
fn trim_line_end(self) -> Self
Trims empty lines from the end of the string.
Dyn Compatibility§
This trait is not dyn compatible.
In older versions of Rust, dyn compatibility was called "object safety".
Implementations on Foreign Types§
Source§impl TrimLine for &str
impl TrimLine for &str
fn trim_line(self) -> Self
fn trim_line_start(self) -> Self
fn trim_line_end(self) -> Self
Source§impl<'a> TrimLine for Cow<'a, str>
Available on crate feature alloc only.
impl<'a> TrimLine for Cow<'a, str>
Available on crate feature
alloc only.