mirror of
https://github.com/rust-lang/rust.git
synced 2024-11-26 08:44:35 +00:00
14 lines
211 B
Rust
14 lines
211 B
Rust
//@ run-pass
|
|
|
|
fn foo(s: &String) -> bool {
|
|
match &**s {
|
|
"kitty" => true,
|
|
_ => false
|
|
}
|
|
}
|
|
|
|
pub fn main() {
|
|
assert!(foo(&"kitty".to_string()));
|
|
assert!(!foo(&"gata".to_string()));
|
|
}
|