We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 5573ad7 commit 8f840f9Copy full SHA for 8f840f9
src/libstd/sort.rs
@@ -9,6 +9,7 @@ export le;
9
export merge_sort;
10
export quick_sort;
11
export quick_sort3;
12
+export Sort;
13
14
type le<T> = pure fn(v1: &T, v2: &T) -> bool;
15
@@ -160,6 +161,14 @@ fn quick_sort3<T: copy Ord Eq>(arr: &[mut T]) {
160
161
qsort3(arr, 0, (arr.len() - 1) as int);
162
}
163
164
+trait Sort {
165
+ fn qsort(self);
166
+}
167
+
168
+impl<T: copy Ord Eq> &[mut T] : Sort {
169
+ fn qsort(self) { quick_sort3(self); }
170
171
172
#[cfg(test)]
173
mod test_qsort3 {
174
fn check_sort(v1: &[mut int], v2: &[mut int]) {
0 commit comments