Skip to content

Commit 87f156b

Browse files
committed
Version 0.6.12
* Move code using specialization into its own module (#161)
2 parents e60df76 + 3ee6d1e commit 87f156b

File tree

3 files changed

+18
-7
lines changed

3 files changed

+18
-7
lines changed

Diff for: Cargo.toml

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
[package]
22
name = "smallvec"
3-
version = "0.6.11"
3+
version = "0.6.12"
44
authors = ["Simon Sapin <[email protected]>"]
55
license = "MIT/Apache-2.0"
66
repository = "https://github.com/servo/rust-smallvec"

Diff for: lib.rs

+1-6
Original file line numberDiff line numberDiff line change
@@ -1253,12 +1253,7 @@ trait SpecFrom<A: Array, S> {
12531253
}
12541254

12551255
#[cfg(feature = "specialization")]
1256-
impl<'a, A: Array> SpecFrom<A, &'a [A::Item]> for SmallVec<A> where A::Item: Clone {
1257-
#[inline]
1258-
default fn spec_from(slice: &'a [A::Item]) -> SmallVec<A> {
1259-
slice.into_iter().cloned().collect()
1260-
}
1261-
}
1256+
mod specialization;
12621257

12631258
#[cfg(feature = "specialization")]
12641259
impl<'a, A: Array> SpecFrom<A, &'a [A::Item]> for SmallVec<A> where A::Item: Copy {

Diff for: specialization.rs

+16
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
1+
// Licensed under the Apache License, Version 2.0 <LICENSE-APACHE or
2+
// http://www.apache.org/licenses/LICENSE-2.0> or the MIT license
3+
// <LICENSE-MIT or http://opensource.org/licenses/MIT>, at your
4+
// option. This file may not be copied, modified, or distributed
5+
// except according to those terms.
6+
7+
//! Implementations that require `default fn`.
8+
9+
use super::{SpecFrom, SmallVec, Array};
10+
11+
impl<'a, A: Array> SpecFrom<A, &'a [A::Item]> for SmallVec<A> where A::Item: Clone {
12+
#[inline]
13+
default fn spec_from(slice: &'a [A::Item]) -> SmallVec<A> {
14+
slice.into_iter().cloned().collect()
15+
}
16+
}

0 commit comments

Comments
 (0)