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");
|
|
|
|
}
|