// except according to those terms.
fn foo(s: &~str) -> bool {
- match s {
- &~"kitty" => true,
+ match s.as_slice() {
+ "kitty" => true,
_ => false
}
}
pub fn main() {
- assert foo(&~"kitty");
- assert !foo(&~"gata");
+ assert!(foo(&"kitty".to_owned()));
+ assert!(!foo(&"gata".to_owned()));
}