We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
2 parents 08b8249 + 511194c commit b640094Copy full SHA for b640094
lib.rs
@@ -1684,6 +1684,17 @@ impl_array!(
1684
0x40000, 0x60000, 0x80000, 0x10_0000
1685
);
1686
1687
+trait ToSmallVec<A:Array> {
1688
+ fn to_smallvec(&self) -> SmallVec<A>;
1689
+}
1690
+
1691
+impl<A:Array> ToSmallVec<A> for [A::Item]
1692
+ where A::Item: Copy {
1693
+ fn to_smallvec(&self) -> SmallVec<A> {
1694
+ SmallVec::from_slice(self)
1695
+ }
1696
1697
1698
#[cfg(test)]
1699
mod tests {
1700
use crate::SmallVec;
0 commit comments