这段程序会输出什么?

来自 生命周期省略与标注
Rust 1.98 进阶 2分钟

这段程序会输出什么?

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}");
    }
}
在试验场中打开
报告错误