/rust/registry/src/index.crates.io-1949cf8c6b5b557f/zerovec-0.11.4/src/zerofrom_impls.rs
Line | Count | Source |
1 | | // This file is part of ICU4X. For terms of use, please see the file |
2 | | // called LICENSE at the top level of the ICU4X source tree |
3 | | // (online at: https://github.com/unicode-org/icu4x/blob/main/LICENSE ). |
4 | | |
5 | | #[cfg(feature = "alloc")] |
6 | | use crate::map::ZeroMapKV; |
7 | | use crate::ule::*; |
8 | | use crate::vecs::VarZeroVecFormat; |
9 | | use crate::{VarZeroSlice, VarZeroVec, ZeroSlice, ZeroVec}; |
10 | | #[cfg(feature = "alloc")] |
11 | | use crate::{ZeroMap, ZeroMap2d}; |
12 | | use zerofrom::ZeroFrom; |
13 | | |
14 | | impl<'zf, T> ZeroFrom<'zf, ZeroVec<'_, T>> for ZeroVec<'zf, T> |
15 | | where |
16 | | T: 'static + AsULE, |
17 | | { |
18 | | #[inline] |
19 | 0 | fn zero_from(other: &'zf ZeroVec<'_, T>) -> Self { |
20 | 0 | ZeroVec::new_borrowed(other.as_ule_slice()) |
21 | 0 | } Unexecuted instantiation: <zerovec::zerovec::ZeroVec<zerovec::ule::niche::NichedOption<icu_locale_core::subtags::script::Script, 4>> as zerofrom::zero_from::ZeroFrom<zerovec::zerovec::ZeroVec<zerovec::ule::niche::NichedOption<icu_locale_core::subtags::script::Script, 4>>>>::zero_from Unexecuted instantiation: <zerovec::zerovec::ZeroVec<icu_properties::script::ScriptWithExt> as zerofrom::zero_from::ZeroFrom<zerovec::zerovec::ZeroVec<icu_properties::script::ScriptWithExt>>>::zero_from Unexecuted instantiation: <zerovec::zerovec::ZeroVec<u8> as zerofrom::zero_from::ZeroFrom<zerovec::zerovec::ZeroVec<u8>>>::zero_from Unexecuted instantiation: <zerovec::zerovec::ZeroVec<char> as zerofrom::zero_from::ZeroFrom<zerovec::zerovec::ZeroVec<char>>>::zero_from Unexecuted instantiation: <zerovec::zerovec::ZeroVec<u32> as zerofrom::zero_from::ZeroFrom<zerovec::zerovec::ZeroVec<u32>>>::zero_from Unexecuted instantiation: <zerovec::zerovec::ZeroVec<potential_utf::uchar::PotentialCodePoint> as zerofrom::zero_from::ZeroFrom<zerovec::zerovec::ZeroVec<potential_utf::uchar::PotentialCodePoint>>>::zero_from Unexecuted instantiation: <zerovec::zerovec::ZeroVec<u16> as zerofrom::zero_from::ZeroFrom<zerovec::zerovec::ZeroVec<u16>>>::zero_from Unexecuted instantiation: <zerovec::zerovec::ZeroVec<_> as zerofrom::zero_from::ZeroFrom<zerovec::zerovec::ZeroVec<_>>>::zero_from |
22 | | } |
23 | | |
24 | | impl<'zf, T> ZeroFrom<'zf, ZeroSlice<T>> for ZeroVec<'zf, T> |
25 | | where |
26 | | T: 'static + AsULE, |
27 | | { |
28 | | #[inline] |
29 | 0 | fn zero_from(other: &'zf ZeroSlice<T>) -> Self { |
30 | 0 | ZeroVec::new_borrowed(other.as_ule_slice()) |
31 | 0 | } Unexecuted instantiation: <zerovec::zerovec::ZeroVec<potential_utf::uchar::PotentialCodePoint> as zerofrom::zero_from::ZeroFrom<zerovec::zerovec::slice::ZeroSlice<potential_utf::uchar::PotentialCodePoint>>>::zero_from Unexecuted instantiation: <zerovec::zerovec::ZeroVec<_> as zerofrom::zero_from::ZeroFrom<zerovec::zerovec::slice::ZeroSlice<_>>>::zero_from |
32 | | } |
33 | | |
34 | | impl<'zf, T> ZeroFrom<'zf, ZeroSlice<T>> for &'zf ZeroSlice<T> |
35 | | where |
36 | | T: 'static + AsULE, |
37 | | { |
38 | | #[inline] |
39 | 0 | fn zero_from(other: &'zf ZeroSlice<T>) -> Self { |
40 | 0 | other |
41 | 0 | } |
42 | | } |
43 | | |
44 | | impl<'zf, T, F: VarZeroVecFormat> ZeroFrom<'zf, VarZeroSlice<T, F>> for VarZeroVec<'zf, T, F> |
45 | | where |
46 | | T: 'static + VarULE + ?Sized, |
47 | | { |
48 | | #[inline] |
49 | 0 | fn zero_from(other: &'zf VarZeroSlice<T, F>) -> Self { |
50 | 0 | other.into() |
51 | 0 | } Unexecuted instantiation: <zerovec::varzerovec::vec::VarZeroVec<str> as zerofrom::zero_from::ZeroFrom<zerovec::varzerovec::slice::VarZeroSlice<str>>>::zero_from Unexecuted instantiation: <zerovec::varzerovec::vec::VarZeroVec<_, _> as zerofrom::zero_from::ZeroFrom<zerovec::varzerovec::slice::VarZeroSlice<_, _>>>::zero_from |
52 | | } |
53 | | |
54 | | impl<'zf, T, F: VarZeroVecFormat> ZeroFrom<'zf, VarZeroVec<'_, T, F>> for VarZeroVec<'zf, T, F> |
55 | | where |
56 | | T: 'static + VarULE + ?Sized, |
57 | | { |
58 | | #[inline] |
59 | 0 | fn zero_from(other: &'zf VarZeroVec<'_, T, F>) -> Self { |
60 | 0 | other.as_slice().into() |
61 | 0 | } Unexecuted instantiation: <zerovec::varzerovec::vec::VarZeroVec<zerovec::zerovec::slice::ZeroSlice<icu_properties::props::Script>> as zerofrom::zero_from::ZeroFrom<zerovec::varzerovec::vec::VarZeroVec<zerovec::zerovec::slice::ZeroSlice<icu_properties::props::Script>>>>::zero_from Unexecuted instantiation: <zerovec::varzerovec::vec::VarZeroVec<str> as zerofrom::zero_from::ZeroFrom<zerovec::varzerovec::vec::VarZeroVec<str>>>::zero_from Unexecuted instantiation: <zerovec::varzerovec::vec::VarZeroVec<_, _> as zerofrom::zero_from::ZeroFrom<zerovec::varzerovec::vec::VarZeroVec<_, _>>>::zero_from |
62 | | } |
63 | | |
64 | | impl<'zf, T> ZeroFrom<'zf, VarZeroSlice<T>> for &'zf VarZeroSlice<T> |
65 | | where |
66 | | T: 'static + VarULE + ?Sized, |
67 | | { |
68 | | #[inline] |
69 | 0 | fn zero_from(other: &'zf VarZeroSlice<T>) -> Self { |
70 | 0 | other |
71 | 0 | } |
72 | | } |
73 | | |
74 | | #[cfg(feature = "alloc")] |
75 | | impl<'zf, 's, K, V> ZeroFrom<'zf, ZeroMap<'s, K, V>> for ZeroMap<'zf, K, V> |
76 | | where |
77 | | K: 'static + for<'b> ZeroMapKV<'b> + ?Sized, |
78 | | V: 'static + for<'b> ZeroMapKV<'b> + ?Sized, |
79 | | <K as ZeroMapKV<'zf>>::Container: ZeroFrom<'zf, <K as ZeroMapKV<'s>>::Container>, |
80 | | <V as ZeroMapKV<'zf>>::Container: ZeroFrom<'zf, <V as ZeroMapKV<'s>>::Container>, |
81 | | { |
82 | 0 | fn zero_from(other: &'zf ZeroMap<'s, K, V>) -> Self { |
83 | 0 | ZeroMap { |
84 | 0 | keys: K::Container::zero_from(&other.keys), |
85 | 0 | values: V::Container::zero_from(&other.values), |
86 | 0 | } |
87 | 0 | } Unexecuted instantiation: <zerovec::map::map::ZeroMap<u16, str> as zerofrom::zero_from::ZeroFrom<zerovec::map::map::ZeroMap<u16, str>>>::zero_from Unexecuted instantiation: <zerovec::map::map::ZeroMap<_, _> as zerofrom::zero_from::ZeroFrom<zerovec::map::map::ZeroMap<_, _>>>::zero_from |
88 | | } |
89 | | |
90 | | #[cfg(feature = "alloc")] |
91 | | impl<'zf, 's, K0, K1, V> ZeroFrom<'zf, ZeroMap2d<'s, K0, K1, V>> for ZeroMap2d<'zf, K0, K1, V> |
92 | | where |
93 | | K0: 'static + for<'b> ZeroMapKV<'b> + ?Sized, |
94 | | K1: 'static + for<'b> ZeroMapKV<'b> + ?Sized, |
95 | | V: 'static + for<'b> ZeroMapKV<'b> + ?Sized, |
96 | | <K0 as ZeroMapKV<'zf>>::Container: ZeroFrom<'zf, <K0 as ZeroMapKV<'s>>::Container>, |
97 | | <K1 as ZeroMapKV<'zf>>::Container: ZeroFrom<'zf, <K1 as ZeroMapKV<'s>>::Container>, |
98 | | <V as ZeroMapKV<'zf>>::Container: ZeroFrom<'zf, <V as ZeroMapKV<'s>>::Container>, |
99 | | { |
100 | 0 | fn zero_from(other: &'zf ZeroMap2d<'s, K0, K1, V>) -> Self { |
101 | 0 | ZeroMap2d { |
102 | 0 | keys0: K0::Container::zero_from(&other.keys0), |
103 | 0 | joiner: ZeroVec::zero_from(&other.joiner), |
104 | 0 | keys1: K1::Container::zero_from(&other.keys1), |
105 | 0 | values: V::Container::zero_from(&other.values), |
106 | 0 | } |
107 | 0 | } |
108 | | } |