Anonymous user
Compare a list of strings: Difference between revisions
m
→{{header|Rust}}
m (Spacing) |
|||
Line 2,601:
=={{header|Rust}}==
<lang rust>fn strings_are_equal(seq: &[&str]) -> bool {▼
▲fn strings_are_equal(seq: &[&str]) -> bool {
match seq {
&[] | &[_] => true,
&[x, y, ref tail @ ..] if x == y => strings_are_equal(&[&[y], tail].concat()),
_ => false
}
Line 2,615 ⟶ 2,612:
match seq {
&[] | &[_] => true,
&[x, y, ref tail @ ..] if x < y => asc_strings(&[&[y], tail].concat()),
_ => false
}
|