File tree Expand file tree Collapse file tree 4 files changed +12
-6
lines changed Expand file tree Collapse file tree 4 files changed +12
-6
lines changed Original file line number Diff line number Diff line change 4
4
mod tests;
5
5
6
6
use crate :: Comparator ;
7
- use std :: cmp:: Ordering ;
7
+ use core :: cmp:: Ordering ;
8
8
9
9
#[ derive( Copy , Clone ) ]
10
10
pub ( crate ) enum Mode {
Original file line number Diff line number Diff line change 3
3
//! on an already-sorted list, smoothly becoming O(n log n) as the sorted
4
4
//! sections (runs) get smaller and smaller.
5
5
6
+ #![ cfg_attr( not( test) , no_std) ]
7
+
8
+ extern crate alloc;
9
+
6
10
mod find_run;
7
11
mod gallop;
8
12
mod insort;
9
13
mod merge;
10
14
mod sort;
11
15
16
+ use core:: cmp:: Ordering ;
17
+ use core:: convert:: Infallible ;
12
18
use sort:: try_sort_by as try_sort_by_cmp;
13
- use std:: cmp:: Ordering ;
14
- use std:: convert:: Infallible ;
15
19
16
20
type NeverResult < T > = Result < T , Infallible > ;
17
21
#[ inline( always) ]
Original file line number Diff line number Diff line change @@ -7,8 +7,9 @@ mod tests;
7
7
8
8
use crate :: gallop:: { self , gallop_left, gallop_right} ;
9
9
use crate :: Comparator ;
10
- use std:: mem:: ManuallyDrop ;
11
- use std:: ptr;
10
+ use alloc:: vec:: Vec ;
11
+ use core:: mem:: ManuallyDrop ;
12
+ use core:: ptr;
12
13
13
14
/// Merge implementation switch.
14
15
pub ( crate ) fn merge < T , C : Comparator < T > > (
Original file line number Diff line number Diff line change @@ -8,7 +8,8 @@ use crate::find_run::get_run;
8
8
use crate :: insort;
9
9
use crate :: merge:: merge;
10
10
use crate :: Comparator ;
11
- use std:: cmp:: min;
11
+ use alloc:: vec:: Vec ;
12
+ use core:: cmp:: min;
12
13
13
14
/// Minimum run length to merge; anything shorter will be lengthend and
14
15
/// sorted using `insort::sort`.
You can’t perform that action at this time.
0 commit comments