Compare commits

...

1 Commits

Author SHA1 Message Date
Fabian Schmidt
c3f1b7b230 Simplified example with lifetimes specified 2024-01-23 11:02:53 +01:00

View File

@ -6,11 +6,7 @@ fn main() {
println!("The longest string is {result}");
}
fn longest<'a, 'b, 'out>(a: &'a str, b: &'b str) -> &'out str
where
'a: 'out,
'b: 'out,
{
fn longest<'a>(a: &'a str, b: &'a str) -> &'a str {
if a.len() > b.len() {
a
} else {