&s and ref s

This commit is contained in:
2020-04-17 08:21:54 +08:00
parent d532226133
commit 9f97aa2823

View File

@@ -13,5 +13,16 @@ fn main() {
println!("{} {}", x, x2);
println!("{} {}", y, y2);
let s = "S".to_owned();
match &s {
ss => println!("{}", ss),
}
match s {
ref ss => println!("{}", ss),
}
}