diff --git a/Cargo.toml b/Cargo.toml index 925aa78..8622f80 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -1,6 +1,6 @@ [package] name = "smallvec" -version = "0.6.11" +version = "0.6.12" authors = ["Simon Sapin "] license = "MIT/Apache-2.0" repository = "https://github.com/servo/rust-smallvec" diff --git a/lib.rs b/lib.rs index c973eb0..cedf2bd 100644 --- a/lib.rs +++ b/lib.rs @@ -1253,12 +1253,7 @@ trait SpecFrom { } #[cfg(feature = "specialization")] -impl<'a, A: Array> SpecFrom for SmallVec where A::Item: Clone { - #[inline] - default fn spec_from(slice: &'a [A::Item]) -> SmallVec { - slice.into_iter().cloned().collect() - } -} +mod specialization; #[cfg(feature = "specialization")] impl<'a, A: Array> SpecFrom for SmallVec where A::Item: Copy { diff --git a/specialization.rs b/specialization.rs new file mode 100644 index 0000000..2e7bb1e --- /dev/null +++ b/specialization.rs @@ -0,0 +1,16 @@ +// Licensed under the Apache License, Version 2.0 or the MIT license +// , at your +// option. This file may not be copied, modified, or distributed +// except according to those terms. + +//! Implementations that require `default fn`. + +use super::{SpecFrom, SmallVec, Array}; + +impl<'a, A: Array> SpecFrom for SmallVec where A::Item: Clone { + #[inline] + default fn spec_from(slice: &'a [A::Item]) -> SmallVec { + slice.into_iter().cloned().collect() + } +}