Format_args!() with long lifetimes

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))
}

(playground)

which does make it a one-liner :slight_smile:

1 Like