rust/tests/ui/issues/issue-3574.rs
2023-01-11 09:32:08 +00:00

15 lines
252 B
Rust

// run-pass
// rustc --test match_borrowed_str.rs.rs && ./match_borrowed_str.rs
fn compare(x: &str, y: &str) -> bool {
match x {
"foo" => y == "foo",
_ => y == "bar",
}
}
pub fn main() {
assert!(compare("foo", "foo"));
}