@@ -2,12 +2,13 @@ use crate::{Buf, BufMut};
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 core:: ops:: { Deref , DerefMut , RangeBounds } ;
7
+ use core:: sync:: atomic:: { self , AtomicUsize , AtomicPtr } ;
8
+ use core:: sync:: atomic:: Ordering :: { Relaxed , Acquire , Release , AcqRel } ;
9
+ use core:: iter:: { FromIterator , Iterator } ;
10
+
11
+ use alloc:: { vec:: Vec , string:: String , boxed:: Box , borrow:: { Borrow , BorrowMut } } ;
11
12
12
13
/// A reference counted contiguous slice of memory.
13
14
///
@@ -316,10 +317,10 @@ struct Inner {
316
317
}
317
318
318
319
// 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
320
+ // the same as `core ::sync::Arc` but without the weak counter. The ref counting
320
321
// fns are based on the ones found in `std`.
321
322
//
322
- // The main reason to use `Shared` instead of `std ::sync::Arc` is that it ends
323
+ // The main reason to use `Shared` instead of `core ::sync::Arc` is that it ends
323
324
// up making the overall code simpler and easier to reason about. This is due to
324
325
// some of the logic around setting `Inner::arc` and other ways the `arc` field
325
326
// is used. Using `Arc` ended up requiring a number of funky transmutes and
@@ -527,7 +528,7 @@ impl Bytes {
527
528
/// Requires that `begin <= end` and `end <= self.len()`, otherwise slicing
528
529
/// will panic.
529
530
pub fn slice ( & self , range : impl RangeBounds < usize > ) -> Bytes {
530
- use std :: ops:: Bound ;
531
+ use core :: ops:: Bound ;
531
532
532
533
let len = self . len ( ) ;
533
534
@@ -857,7 +858,7 @@ impl Bytes {
857
858
/// assert_eq!(iter.next().map(|b| *b), Some(b'c'));
858
859
/// assert_eq!(iter.next(), None);
859
860
/// ```
860
- pub fn iter < ' a > ( & ' a self ) -> std :: slice:: Iter < ' a , u8 > {
861
+ pub fn iter < ' a > ( & ' a self ) -> core :: slice:: Iter < ' a , u8 > {
861
862
self . bytes ( ) . iter ( )
862
863
}
863
864
}
@@ -1031,7 +1032,7 @@ impl IntoIterator for Bytes {
1031
1032
1032
1033
impl < ' a > IntoIterator for & ' a Bytes {
1033
1034
type Item = & ' a u8 ;
1034
- type IntoIter = std :: slice:: Iter < ' a , u8 > ;
1035
+ type IntoIter = core :: slice:: Iter < ' a , u8 > ;
1035
1036
1036
1037
fn into_iter ( self ) -> Self :: IntoIter {
1037
1038
self . as_ref ( ) . into_iter ( )
@@ -1539,7 +1540,7 @@ impl BytesMut {
1539
1540
/// assert_eq!(iter.next().map(|b| *b), Some(b'c'));
1540
1541
/// assert_eq!(iter.next(), None);
1541
1542
/// ```
1542
- pub fn iter < ' a > ( & ' a self ) -> std :: slice:: Iter < ' a , u8 > {
1543
+ pub fn iter < ' a > ( & ' a self ) -> core :: slice:: Iter < ' a , u8 > {
1543
1544
self . bytes ( ) . iter ( )
1544
1545
}
1545
1546
}
@@ -1780,7 +1781,7 @@ impl IntoIterator for BytesMut {
1780
1781
1781
1782
impl < ' a > IntoIterator for & ' a BytesMut {
1782
1783
type Item = & ' a u8 ;
1783
- type IntoIter = std :: slice:: Iter < ' a , u8 > ;
1784
+ type IntoIter = core :: slice:: Iter < ' a , u8 > ;
1784
1785
1785
1786
fn into_iter ( self ) -> Self :: IntoIter {
1786
1787
self . as_ref ( ) . into_iter ( )
0 commit comments