1- use { IntoBuf , Buf , BufMut } ;
1+ use { BufMut } ;
2+ #[ cfg( feature = "std" ) ]
3+ use { Buf , IntoBuf } ;
4+ #[ cfg( feature = "std" ) ]
25use buf:: Iter ;
36use debug;
47use prelude:: * ;
58
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" ) ]
816use 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 } ;
1217
1318/// A reference counted contiguous slice of memory.
1419///
@@ -835,6 +840,7 @@ impl Bytes {
835840 }
836841}
837842
843+ #[ cfg( feature = "std" ) ]
838844impl IntoBuf for Bytes {
839845 type Buf = Cursor < Self > ;
840846
@@ -843,6 +849,7 @@ impl IntoBuf for Bytes {
843849 }
844850}
845851
852+ #[ cfg( feature = "std" ) ]
846853impl < ' a > IntoBuf for & ' a Bytes {
847854 type Buf = Cursor < Self > ;
848855
@@ -986,6 +993,7 @@ impl Borrow<[u8]> for Bytes {
986993 }
987994}
988995
996+ #[ cfg( feature = "std" ) ]
989997impl IntoIterator for Bytes {
990998 type Item = u8 ;
991999 type IntoIter = Iter < Cursor < Bytes > > ;
@@ -995,6 +1003,7 @@ impl IntoIterator for Bytes {
9951003 }
9961004}
9971005
1006+ #[ cfg( feature = "std" ) ]
9981007impl < ' a > IntoIterator for & ' a Bytes {
9991008 type Item = u8 ;
10001009 type IntoIter = Iter < Cursor < & ' a Bytes > > ;
@@ -1563,6 +1572,7 @@ impl BufMut for BytesMut {
15631572 }
15641573}
15651574
1575+ #[ cfg( feature = "std" ) ]
15661576impl IntoBuf for BytesMut {
15671577 type Buf = Cursor < Self > ;
15681578
@@ -1571,6 +1581,7 @@ impl IntoBuf for BytesMut {
15711581 }
15721582}
15731583
1584+ #[ cfg( feature = "std" ) ]
15741585impl < ' a > IntoBuf for & ' a BytesMut {
15751586 type Buf = Cursor < & ' a BytesMut > ;
15761587
@@ -1736,6 +1747,7 @@ impl Clone for BytesMut {
17361747 }
17371748}
17381749
1750+ #[ cfg( feature = "std" ) ]
17391751impl IntoIterator for BytesMut {
17401752 type Item = u8 ;
17411753 type IntoIter = Iter < Cursor < BytesMut > > ;
@@ -1745,6 +1757,7 @@ impl IntoIterator for BytesMut {
17451757 }
17461758}
17471759
1760+ #[ cfg( feature = "std" ) ]
17481761impl < ' a > IntoIterator for & ' a BytesMut {
17491762 type Item = u8 ;
17501763 type IntoIter = Iter < Cursor < & ' a BytesMut > > ;
0 commit comments