Lesson 24 of 50
rustLifetimes
20 minutes
Course progress48%
Lifetimes
Lifetimes ensure that references are valid for as long as they are used.
fn longest<'a>(a: &'a str, b: &'a str) -> &'a str {
a.() > b.() { a } { b }
}
() {
= \Lesson 24 of 50
rust20 minutes
Lifetimes ensure that references are valid for as long as they are used.
fn longest<'a>(a: &'a str, b: &'a str) -> &'a str {
a.() > b.() { a } { b }
}
() {
= \