@@ -40,29 +40,28 @@ extern crate alloc;
40
40
#[ cfg( any( test, feature = "write" ) ) ]
41
41
extern crate std;
42
42
43
- #[ cfg( feature = "serde" ) ]
44
- extern crate serde;
45
-
46
- #[ cfg( feature = "serde" ) ]
47
- use serde:: de:: { Deserialize , Deserializer , SeqAccess , Visitor } ;
48
- #[ cfg( feature = "serde" ) ]
49
- use serde:: ser:: { Serialize , SerializeSeq , Serializer } ;
50
-
51
43
use alloc:: vec:: Vec ;
52
44
use core:: borrow:: { Borrow , BorrowMut } ;
53
45
use core:: cmp;
54
46
use core:: fmt;
55
47
use core:: hash:: { Hash , Hasher } ;
56
48
use core:: hint:: unreachable_unchecked;
57
49
use core:: iter:: { repeat, FromIterator , FusedIterator , IntoIterator } ;
58
- #[ cfg( feature = "serde" ) ]
59
- use core:: marker:: PhantomData ;
60
50
use core:: mem;
61
51
use core:: mem:: MaybeUninit ;
62
- use core:: ops:: { self , Bound , RangeBounds } ;
52
+ use core:: ops:: { self , RangeBounds } ;
63
53
use core:: ptr:: { self , NonNull } ;
64
54
use core:: slice:: { self , SliceIndex } ;
65
55
56
+ #[ cfg( feature = "serde" ) ]
57
+ use serde:: {
58
+ de:: { Deserialize , Deserializer , SeqAccess , Visitor } ,
59
+ ser:: { Serialize , SerializeSeq , Serializer } ,
60
+ } ;
61
+
62
+ #[ cfg( feature = "serde" ) ]
63
+ use core:: marker:: PhantomData ;
64
+
66
65
#[ cfg( feature = "write" ) ]
67
66
use std:: io;
68
67
@@ -190,7 +189,7 @@ impl<'a, T: 'a + Array> fmt::Debug for Drain<'a, T>
190
189
where
191
190
T :: Item : fmt:: Debug ,
192
191
{
193
- fn fmt ( & self , f : & mut fmt:: Formatter ) -> fmt:: Result {
192
+ fn fmt ( & self , f : & mut fmt:: Formatter < ' _ > ) -> fmt:: Result {
194
193
f. debug_tuple ( "Drain" ) . field ( & self . iter . as_slice ( ) ) . finish ( )
195
194
}
196
195
}
@@ -597,11 +596,11 @@ impl<A: Array> SmallVec<A> {
597
596
///
598
597
/// Panics if the starting point is greater than the end point or if
599
598
/// the end point is greater than the length of the vector.
600
- pub fn drain < R > ( & mut self , range : R ) -> Drain < A >
599
+ pub fn drain < R > ( & mut self , range : R ) -> Drain < ' _ , A >
601
600
where
602
601
R : RangeBounds < usize > ,
603
602
{
604
- use Bound :: * ;
603
+ use core :: ops :: Bound :: * ;
605
604
606
605
let len = self . len ( ) ;
607
606
let start = match range. start_bound ( ) {
@@ -1274,7 +1273,7 @@ where
1274
1273
{
1275
1274
type Value = SmallVec < A > ;
1276
1275
1277
- fn expecting ( & self , formatter : & mut fmt:: Formatter ) -> fmt:: Result {
1276
+ fn expecting ( & self , formatter : & mut fmt:: Formatter < ' _ > ) -> fmt:: Result {
1278
1277
formatter. write_str ( "a sequence" )
1279
1278
}
1280
1279
@@ -1403,7 +1402,7 @@ impl<A: Array> fmt::Debug for SmallVec<A>
1403
1402
where
1404
1403
A :: Item : fmt:: Debug ,
1405
1404
{
1406
- fn fmt ( & self , f : & mut fmt:: Formatter ) -> fmt:: Result {
1405
+ fn fmt ( & self , f : & mut fmt:: Formatter < ' _ > ) -> fmt:: Result {
1407
1406
f. debug_list ( ) . entries ( self . iter ( ) ) . finish ( )
1408
1407
}
1409
1408
}
@@ -1655,7 +1654,7 @@ impl_array!(
1655
1654
1656
1655
#[ cfg( test) ]
1657
1656
mod tests {
1658
- use SmallVec ;
1657
+ use crate :: SmallVec ;
1659
1658
1660
1659
use std:: iter:: FromIterator ;
1661
1660
@@ -1832,15 +1831,15 @@ mod tests {
1832
1831
1833
1832
{
1834
1833
let cell = Cell :: new ( 0 ) ;
1835
- let mut v: SmallVec < [ DropCounter ; 2 ] > = SmallVec :: new ( ) ;
1834
+ let mut v: SmallVec < [ DropCounter < ' _ > ; 2 ] > = SmallVec :: new ( ) ;
1836
1835
v. push ( DropCounter ( & cell) ) ;
1837
1836
v. into_iter ( ) ;
1838
1837
assert_eq ! ( cell. get( ) , 1 ) ;
1839
1838
}
1840
1839
1841
1840
{
1842
1841
let cell = Cell :: new ( 0 ) ;
1843
- let mut v: SmallVec < [ DropCounter ; 2 ] > = SmallVec :: new ( ) ;
1842
+ let mut v: SmallVec < [ DropCounter < ' _ > ; 2 ] > = SmallVec :: new ( ) ;
1844
1843
v. push ( DropCounter ( & cell) ) ;
1845
1844
v. push ( DropCounter ( & cell) ) ;
1846
1845
assert ! ( v. into_iter( ) . next( ) . is_some( ) ) ;
@@ -1849,7 +1848,7 @@ mod tests {
1849
1848
1850
1849
{
1851
1850
let cell = Cell :: new ( 0 ) ;
1852
- let mut v: SmallVec < [ DropCounter ; 2 ] > = SmallVec :: new ( ) ;
1851
+ let mut v: SmallVec < [ DropCounter < ' _ > ; 2 ] > = SmallVec :: new ( ) ;
1853
1852
v. push ( DropCounter ( & cell) ) ;
1854
1853
v. push ( DropCounter ( & cell) ) ;
1855
1854
v. push ( DropCounter ( & cell) ) ;
@@ -1858,7 +1857,7 @@ mod tests {
1858
1857
}
1859
1858
{
1860
1859
let cell = Cell :: new ( 0 ) ;
1861
- let mut v: SmallVec < [ DropCounter ; 2 ] > = SmallVec :: new ( ) ;
1860
+ let mut v: SmallVec < [ DropCounter < ' _ > ; 2 ] > = SmallVec :: new ( ) ;
1862
1861
v. push ( DropCounter ( & cell) ) ;
1863
1862
v. push ( DropCounter ( & cell) ) ;
1864
1863
v. push ( DropCounter ( & cell) ) ;
0 commit comments