Skip to content

Commit a2c0504

Browse files
author
bors-servo
authored
Auto merge of #174 - mbrubeck:2018, r=jdm
Update to Rust 2018 edition None
2 parents 01917a6 + a51059c commit a2c0504

File tree

2 files changed

+21
-21
lines changed

2 files changed

+21
-21
lines changed

Cargo.toml

+1
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
[package]
22
name = "smallvec"
33
version = "0.6.10"
4+
edition = "2018"
45
authors = ["Simon Sapin <[email protected]>"]
56
license = "MIT/Apache-2.0"
67
repository = "https://github.com/servo/rust-smallvec"

lib.rs

+20-21
Original file line numberDiff line numberDiff line change
@@ -40,29 +40,28 @@ extern crate alloc;
4040
#[cfg(any(test, feature = "write"))]
4141
extern crate std;
4242

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-
5143
use alloc::vec::Vec;
5244
use core::borrow::{Borrow, BorrowMut};
5345
use core::cmp;
5446
use core::fmt;
5547
use core::hash::{Hash, Hasher};
5648
use core::hint::unreachable_unchecked;
5749
use core::iter::{repeat, FromIterator, FusedIterator, IntoIterator};
58-
#[cfg(feature = "serde")]
59-
use core::marker::PhantomData;
6050
use core::mem;
6151
use core::mem::MaybeUninit;
62-
use core::ops::{self, Bound, RangeBounds};
52+
use core::ops::{self, RangeBounds};
6353
use core::ptr::{self, NonNull};
6454
use core::slice::{self, SliceIndex};
6555

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+
6665
#[cfg(feature = "write")]
6766
use std::io;
6867

@@ -190,7 +189,7 @@ impl<'a, T: 'a + Array> fmt::Debug for Drain<'a, T>
190189
where
191190
T::Item: fmt::Debug,
192191
{
193-
fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
192+
fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result {
194193
f.debug_tuple("Drain").field(&self.iter.as_slice()).finish()
195194
}
196195
}
@@ -597,11 +596,11 @@ impl<A: Array> SmallVec<A> {
597596
///
598597
/// Panics if the starting point is greater than the end point or if
599598
/// 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>
601600
where
602601
R: RangeBounds<usize>,
603602
{
604-
use Bound::*;
603+
use core::ops::Bound::*;
605604

606605
let len = self.len();
607606
let start = match range.start_bound() {
@@ -1274,7 +1273,7 @@ where
12741273
{
12751274
type Value = SmallVec<A>;
12761275

1277-
fn expecting(&self, formatter: &mut fmt::Formatter) -> fmt::Result {
1276+
fn expecting(&self, formatter: &mut fmt::Formatter<'_>) -> fmt::Result {
12781277
formatter.write_str("a sequence")
12791278
}
12801279

@@ -1403,7 +1402,7 @@ impl<A: Array> fmt::Debug for SmallVec<A>
14031402
where
14041403
A::Item: fmt::Debug,
14051404
{
1406-
fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
1405+
fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result {
14071406
f.debug_list().entries(self.iter()).finish()
14081407
}
14091408
}
@@ -1655,7 +1654,7 @@ impl_array!(
16551654

16561655
#[cfg(test)]
16571656
mod tests {
1658-
use SmallVec;
1657+
use crate::SmallVec;
16591658

16601659
use std::iter::FromIterator;
16611660

@@ -1832,15 +1831,15 @@ mod tests {
18321831

18331832
{
18341833
let cell = Cell::new(0);
1835-
let mut v: SmallVec<[DropCounter; 2]> = SmallVec::new();
1834+
let mut v: SmallVec<[DropCounter<'_>; 2]> = SmallVec::new();
18361835
v.push(DropCounter(&cell));
18371836
v.into_iter();
18381837
assert_eq!(cell.get(), 1);
18391838
}
18401839

18411840
{
18421841
let cell = Cell::new(0);
1843-
let mut v: SmallVec<[DropCounter; 2]> = SmallVec::new();
1842+
let mut v: SmallVec<[DropCounter<'_>; 2]> = SmallVec::new();
18441843
v.push(DropCounter(&cell));
18451844
v.push(DropCounter(&cell));
18461845
assert!(v.into_iter().next().is_some());
@@ -1849,7 +1848,7 @@ mod tests {
18491848

18501849
{
18511850
let cell = Cell::new(0);
1852-
let mut v: SmallVec<[DropCounter; 2]> = SmallVec::new();
1851+
let mut v: SmallVec<[DropCounter<'_>; 2]> = SmallVec::new();
18531852
v.push(DropCounter(&cell));
18541853
v.push(DropCounter(&cell));
18551854
v.push(DropCounter(&cell));
@@ -1858,7 +1857,7 @@ mod tests {
18581857
}
18591858
{
18601859
let cell = Cell::new(0);
1861-
let mut v: SmallVec<[DropCounter; 2]> = SmallVec::new();
1860+
let mut v: SmallVec<[DropCounter<'_>; 2]> = SmallVec::new();
18621861
v.push(DropCounter(&cell));
18631862
v.push(DropCounter(&cell));
18641863
v.push(DropCounter(&cell));

0 commit comments

Comments
 (0)