With a function like this one this would be written as
fn formatted(&self) -> impl fmt::Display + '_ {
display_with(|f| write!(f, "Hi! I'm {}", self.name))
}
which does make it a one-liner
With a function like this one this would be written as
fn formatted(&self) -> impl fmt::Display + '_ {
display_with(|f| write!(f, "Hi! I'm {}", self.name))
}
which does make it a one-liner