67
67
#![ warn( missing_docs) ]
68
68
#![ no_std]
69
69
70
- use core:: cmp:: { self , Ordering } ;
71
- use core:: iter;
70
+ use core:: {
71
+ cmp:: { self , Ordering } ,
72
+ iter,
73
+ } ;
72
74
73
- #[ cfg( all( feature = "alloc" , not( feature = "std" ) ) ) ]
74
- #[ cfg_attr( test, macro_use) ]
75
+ #[ cfg( feature = "alloc" ) ]
75
76
extern crate alloc;
76
77
77
- #[ cfg( all( feature = "alloc" , not( feature = "std" ) ) ) ]
78
- mod imports {
79
- pub use alloc:: boxed:: Box ;
80
- pub use alloc:: collections:: btree_map:: BTreeMap ;
81
- pub use alloc:: collections:: btree_set:: BTreeSet ;
82
- pub use alloc:: vec:: Vec ;
83
- }
84
-
85
- #[ cfg( feature = "std" ) ]
86
- #[ cfg_attr( test, macro_use) ]
87
- extern crate std;
88
-
89
- #[ cfg( feature = "std" ) ]
90
- mod imports {
91
- pub use std:: collections:: { BTreeMap , BTreeSet , HashMap , HashSet } ;
92
- pub use std:: hash:: { BuildHasher , Hash } ;
93
- pub use std:: prelude:: v1:: * ;
94
- }
95
-
96
- #[ cfg( any( feature = "std" , feature = "alloc" ) ) ]
97
- use crate :: imports:: * ;
78
+ #[ cfg( feature = "alloc" ) ]
79
+ pub use alloc:: {
80
+ boxed:: Box ,
81
+ collections:: { BTreeMap , BTreeSet } ,
82
+ vec:: Vec ,
83
+ } ;
98
84
99
- #[ cfg( any( feature = "std" , feature = "alloc" ) ) ]
100
- #[ cfg( test) ]
85
+ #[ cfg( all( test, feature = "alloc" ) ) ]
101
86
mod test;
102
87
103
88
enum FoldStop < T , E > {
@@ -1000,7 +985,7 @@ impl<I: DoubleEndedFallibleIterator + ?Sized> DoubleEndedFallibleIterator for &m
1000
985
}
1001
986
}
1002
987
1003
- #[ cfg( any ( feature = "std" , feature = " alloc") ) ]
988
+ #[ cfg( feature = "alloc" ) ]
1004
989
impl < I : FallibleIterator + ?Sized > FallibleIterator for Box < I > {
1005
990
type Item = I :: Item ;
1006
991
type Error = I :: Error ;
@@ -1021,7 +1006,7 @@ impl<I: FallibleIterator + ?Sized> FallibleIterator for Box<I> {
1021
1006
}
1022
1007
}
1023
1008
1024
- #[ cfg( any ( feature = "std" , feature = " alloc") ) ]
1009
+ #[ cfg( feature = "alloc" ) ]
1025
1010
impl < I : DoubleEndedFallibleIterator + ?Sized > DoubleEndedFallibleIterator for Box < I > {
1026
1011
#[ inline]
1027
1012
fn next_back ( & mut self ) -> Result < Option < I :: Item > , I :: Error > {
0 commit comments