File tree Expand file tree Collapse file tree 3 files changed +871
-0
lines changed Expand file tree Collapse file tree 3 files changed +871
-0
lines changed Original file line number Diff line number Diff line change @@ -101,6 +101,7 @@ mod defmt;
101
101
pub mod mpmc;
102
102
#[ cfg( all( has_cas, feature = "cas" ) ) ]
103
103
pub mod pool;
104
+ pub mod sorted_linked_list;
104
105
#[ cfg( has_atomics) ]
105
106
pub mod spsc;
106
107
Original file line number Diff line number Diff line change @@ -22,6 +22,36 @@ pub mod binary_heap {
22
22
}
23
23
}
24
24
25
+ /// Sealed traits and implementations for `LinkedList`
26
+ pub mod sorted_linked_list {
27
+ use crate :: sorted_linked_list:: { Max , Min } ;
28
+ use core:: cmp:: Ordering ;
29
+
30
+ /// The linked list kind: min-list or max-list
31
+ pub unsafe trait Kind {
32
+ #[ doc( hidden) ]
33
+ fn ordering ( ) -> Ordering ;
34
+ }
35
+
36
+ unsafe impl Kind for Min {
37
+ fn ordering ( ) -> Ordering {
38
+ Ordering :: Less
39
+ }
40
+ }
41
+
42
+ unsafe impl Kind for Max {
43
+ fn ordering ( ) -> Ordering {
44
+ Ordering :: Greater
45
+ }
46
+ }
47
+ }
48
+
49
+ #[ allow( dead_code) ]
50
+ #[ allow( path_statements) ]
51
+ pub ( crate ) const fn smaller_than < const N : usize , const MAX : usize > ( ) {
52
+ Assert :: < N , MAX > :: LESS ;
53
+ }
54
+
25
55
#[ allow( dead_code) ]
26
56
#[ allow( path_statements) ]
27
57
pub ( crate ) const fn greater_than_0 < const N : usize > ( ) {
You can’t perform that action at this time.
0 commit comments