From 1b6a04ca5504955c571d1c97504fb45ea0befee4 Mon Sep 17 00:00:00 2001 From: Valentin Popov Date: Mon, 8 Jan 2024 01:21:28 +0400 Subject: Initial vendor packages Signed-off-by: Valentin Popov --- vendor/smallvec/src/specialization.rs | 19 +++++++++++++++++++ 1 file changed, 19 insertions(+) create mode 100644 vendor/smallvec/src/specialization.rs (limited to 'vendor/smallvec/src/specialization.rs') diff --git a/vendor/smallvec/src/specialization.rs b/vendor/smallvec/src/specialization.rs new file mode 100644 index 0000000..658fa77 --- /dev/null +++ b/vendor/smallvec/src/specialization.rs @@ -0,0 +1,19 @@ +// 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::{Array, SmallVec, SpecFrom}; + +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() + } +} -- cgit v1.2.3