| 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::{Array, SmallVec, SpecFrom}; |
| 10 |
|
| 11 |
impl<'a, A: Array> SpecFrom<A, &'a [A::Item]> for SmallVec<A> |
| 12 |
where |
| 13 |
A::Item: Clone, |
| 14 |
{ |
| 15 |
#[inline] |
| 16 |
default fn spec_from(slice: &'a [A::Item]) -> SmallVec<A> { |
| 17 |
slice.into_iter().cloned().collect() |
| 18 |
} |
| 19 |
} |