1
- use { IntoBuf , Buf , BufMut } ;
1
+ use { BufMut } ;
2
+ #[ cfg( feature = "std" ) ]
3
+ use { Buf , IntoBuf } ;
4
+ #[ cfg( feature = "std" ) ]
2
5
use buf:: Iter ;
3
6
use debug;
4
7
use prelude:: * ;
5
8
6
- use std:: { cmp, fmt, mem, hash, ops, slice, ptr, usize} ;
7
- use std:: borrow:: { Borrow , BorrowMut } ;
9
+ use core:: { cmp, fmt, mem, hash, ops, slice, ptr, usize} ;
10
+ use core:: borrow:: { Borrow , BorrowMut } ;
11
+ use core:: sync:: atomic:: { self , AtomicUsize , AtomicPtr } ;
12
+ use core:: sync:: atomic:: Ordering :: { Relaxed , Acquire , Release , AcqRel } ;
13
+ use core:: iter:: { FromIterator , Iterator } ;
14
+
15
+ #[ cfg( feature = "std" ) ]
8
16
use std:: io:: Cursor ;
9
- use std:: sync:: atomic:: { self , AtomicUsize , AtomicPtr } ;
10
- use std:: sync:: atomic:: Ordering :: { Relaxed , Acquire , Release , AcqRel } ;
11
- use std:: iter:: { FromIterator , Iterator } ;
12
17
13
18
/// A reference counted contiguous slice of memory.
14
19
///
@@ -835,6 +840,7 @@ impl Bytes {
835
840
}
836
841
}
837
842
843
+ #[ cfg( feature = "std" ) ]
838
844
impl IntoBuf for Bytes {
839
845
type Buf = Cursor < Self > ;
840
846
@@ -843,6 +849,7 @@ impl IntoBuf for Bytes {
843
849
}
844
850
}
845
851
852
+ #[ cfg( feature = "std" ) ]
846
853
impl < ' a > IntoBuf for & ' a Bytes {
847
854
type Buf = Cursor < Self > ;
848
855
@@ -986,6 +993,7 @@ impl Borrow<[u8]> for Bytes {
986
993
}
987
994
}
988
995
996
+ #[ cfg( feature = "std" ) ]
989
997
impl IntoIterator for Bytes {
990
998
type Item = u8 ;
991
999
type IntoIter = Iter < Cursor < Bytes > > ;
@@ -995,6 +1003,7 @@ impl IntoIterator for Bytes {
995
1003
}
996
1004
}
997
1005
1006
+ #[ cfg( feature = "std" ) ]
998
1007
impl < ' a > IntoIterator for & ' a Bytes {
999
1008
type Item = u8 ;
1000
1009
type IntoIter = Iter < Cursor < & ' a Bytes > > ;
@@ -1563,6 +1572,7 @@ impl BufMut for BytesMut {
1563
1572
}
1564
1573
}
1565
1574
1575
+ #[ cfg( feature = "std" ) ]
1566
1576
impl IntoBuf for BytesMut {
1567
1577
type Buf = Cursor < Self > ;
1568
1578
@@ -1571,6 +1581,7 @@ impl IntoBuf for BytesMut {
1571
1581
}
1572
1582
}
1573
1583
1584
+ #[ cfg( feature = "std" ) ]
1574
1585
impl < ' a > IntoBuf for & ' a BytesMut {
1575
1586
type Buf = Cursor < & ' a BytesMut > ;
1576
1587
@@ -1736,6 +1747,7 @@ impl Clone for BytesMut {
1736
1747
}
1737
1748
}
1738
1749
1750
+ #[ cfg( feature = "std" ) ]
1739
1751
impl IntoIterator for BytesMut {
1740
1752
type Item = u8 ;
1741
1753
type IntoIter = Iter < Cursor < BytesMut > > ;
@@ -1745,6 +1757,7 @@ impl IntoIterator for BytesMut {
1745
1757
}
1746
1758
}
1747
1759
1760
+ #[ cfg( feature = "std" ) ]
1748
1761
impl < ' a > IntoIterator for & ' a BytesMut {
1749
1762
type Item = u8 ;
1750
1763
type IntoIter = Iter < Cursor < & ' a BytesMut > > ;
0 commit comments