@@ -2,12 +2,12 @@ use crate::{Buf, BufMut, IntoBuf};
2
2
use crate :: buf:: IntoIter ;
3
3
use crate :: debug;
4
4
5
- use std :: { cmp, fmt, mem, hash, slice, ptr, usize} ;
6
- use std :: borrow:: { Borrow , BorrowMut } ;
7
- use std :: ops:: { Deref , DerefMut , RangeBounds } ;
8
- use std :: sync:: atomic:: { self , AtomicUsize , AtomicPtr } ;
9
- use std :: sync:: atomic:: Ordering :: { Relaxed , Acquire , Release , AcqRel } ;
10
- use std :: iter:: { FromIterator , Iterator } ;
5
+ use core :: { cmp, fmt, mem, hash, slice, ptr, usize} ;
6
+ use alloc :: borrow:: { Borrow , BorrowMut } ;
7
+ use core :: ops:: { Deref , DerefMut , RangeBounds } ;
8
+ use core :: sync:: atomic:: { self , AtomicUsize , AtomicPtr } ;
9
+ use core :: sync:: atomic:: Ordering :: { Relaxed , Acquire , Release , AcqRel } ;
10
+ use core :: iter:: { FromIterator , Iterator } ;
11
11
12
12
/// A reference counted contiguous slice of memory.
13
13
///
@@ -316,10 +316,10 @@ struct Inner {
316
316
}
317
317
318
318
// Thread-safe reference-counted container for the shared storage. This mostly
319
- // the same as `std ::sync::Arc` but without the weak counter. The ref counting
319
+ // the same as `core ::sync::Arc` but without the weak counter. The ref counting
320
320
// fns are based on the ones found in `std`.
321
321
//
322
- // The main reason to use `Shared` instead of `std ::sync::Arc` is that it ends
322
+ // The main reason to use `Shared` instead of `core ::sync::Arc` is that it ends
323
323
// up making the overall code simpler and easier to reason about. This is due to
324
324
// some of the logic around setting `Inner::arc` and other ways the `arc` field
325
325
// is used. Using `Arc` ended up requiring a number of funky transmutes and
@@ -522,7 +522,7 @@ impl Bytes {
522
522
/// Requires that `begin <= end` and `end <= self.len()`, otherwise slicing
523
523
/// will panic.
524
524
pub fn slice ( & self , range : impl RangeBounds < usize > ) -> Bytes {
525
- use std :: ops:: Bound ;
525
+ use core :: ops:: Bound ;
526
526
527
527
let len = self . len ( ) ;
528
528
@@ -852,7 +852,7 @@ impl Bytes {
852
852
/// assert_eq!(iter.next().map(|b| *b), Some(b'c'));
853
853
/// assert_eq!(iter.next(), None);
854
854
/// ```
855
- pub fn iter < ' a > ( & ' a self ) -> std :: slice:: Iter < ' a , u8 > {
855
+ pub fn iter < ' a > ( & ' a self ) -> core :: slice:: Iter < ' a , u8 > {
856
856
self . bytes ( ) . iter ( )
857
857
}
858
858
}
@@ -1026,7 +1026,7 @@ impl IntoIterator for Bytes {
1026
1026
1027
1027
impl < ' a > IntoIterator for & ' a Bytes {
1028
1028
type Item = & ' a u8 ;
1029
- type IntoIter = std :: slice:: Iter < ' a , u8 > ;
1029
+ type IntoIter = core :: slice:: Iter < ' a , u8 > ;
1030
1030
1031
1031
fn into_iter ( self ) -> Self :: IntoIter {
1032
1032
self . as_ref ( ) . into_iter ( )
@@ -1534,7 +1534,7 @@ impl BytesMut {
1534
1534
/// assert_eq!(iter.next().map(|b| *b), Some(b'c'));
1535
1535
/// assert_eq!(iter.next(), None);
1536
1536
/// ```
1537
- pub fn iter < ' a > ( & ' a self ) -> std :: slice:: Iter < ' a , u8 > {
1537
+ pub fn iter < ' a > ( & ' a self ) -> core :: slice:: Iter < ' a , u8 > {
1538
1538
self . bytes ( ) . iter ( )
1539
1539
}
1540
1540
}
@@ -1783,7 +1783,7 @@ impl IntoIterator for BytesMut {
1783
1783
1784
1784
impl < ' a > IntoIterator for & ' a BytesMut {
1785
1785
type Item = & ' a u8 ;
1786
- type IntoIter = std :: slice:: Iter < ' a , u8 > ;
1786
+ type IntoIter = core :: slice:: Iter < ' a , u8 > ;
1787
1787
1788
1788
fn into_iter ( self ) -> Self :: IntoIter {
1789
1789
self . as_ref ( ) . into_iter ( )
0 commit comments