Check out example codes for "rust match string". It will help you in understanding the concepts better.

Code Example 1

match stringthing.as_str() {
    "a" => println!("0"),
    "b" => println!("1"),
    "c" => println!("2"),
    _ => println!("something else!"),
}

Learn ReactJs, React Native from akashmittal.com