What does this program print?

from Lifetime elision and annotations
Rust 1.98 intermediate 2 min

What does this program print?

Rust
fn select<'a>(left: &'a str, right: &'a str, use_left: bool) -> &'a str {
    if use_left { left } else { right }
}

fn main() {
    let outer = String::from("east");

    {
        let inner = String::from("west");
        let result = select(&outer, &inner, true);
        println!("{result}");
    }
}
Open in playground
Report an error