rust/src/test/run-pass/borrowed-ptr-pattern-2.rs

12 lines
164 B
Rust
Raw Normal View History

2012-09-23 07:39:39 -05:00
fn foo(s: &~str) -> bool {
2012-09-07 19:07:32 -05:00
match s {
2012-09-23 07:39:39 -05:00
&~"kitty" => true,
_ => false
2012-09-07 19:07:32 -05:00
}
}
fn main() {
2012-09-23 07:39:39 -05:00
assert foo(&~"kitty");
assert !foo(&~"gata");
}