&s and ref s
This commit is contained in:
@@ -13,5 +13,16 @@ fn main() {
|
|||||||
|
|
||||||
println!("{} {}", x, x2);
|
println!("{} {}", x, x2);
|
||||||
println!("{} {}", y, y2);
|
println!("{} {}", y, y2);
|
||||||
|
|
||||||
|
let s = "S".to_owned();
|
||||||
|
|
||||||
|
|
||||||
|
match &s {
|
||||||
|
ss => println!("{}", ss),
|
||||||
|
}
|
||||||
|
|
||||||
|
match s {
|
||||||
|
ref ss => println!("{}", ss),
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user