[][src]Function tao_of_rust::ch02::enums::match_ref_2018

pub fn match_ref_2018()

match 匹配引用 (Rust 2018 用法)

Basic usage:

fn match_ref_2018() {
    let s: &Option<String> = &Some("hello".to_string());
    match s {
        Some(s) => println!("s is: {}", s),
        _ => (),
    };
}
match_ref_2018();Run