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