Skip to content

Commit

Permalink
Update bitrotten pr #10.
Browse files Browse the repository at this point in the history
  • Loading branch information
BurntSushi committed Dec 2, 2014
1 parent 7c3ffbd commit 1e6e246
Showing 1 changed file with 4 additions and 3 deletions.
7 changes: 4 additions & 3 deletions examples/sort.rs
Expand Up @@ -21,9 +21,10 @@ fn sortk<T: Clone + Ord>(x: &T, xs: &[T]) -> Vec<T> {
}

fn sort<T: Clone + Ord>(list: &[T]) -> Vec<T> {
match list {
[] => vec!(),
[ref x, ..xs] => sortk(x, xs)
if list.is_empty() {
vec![]
} else {
sortk(&list[0], list.tail())
}
}

Expand Down

0 comments on commit 1e6e246

Please sign in to comment.