diff options
author | Daniel Baumann <daniel.baumann@progress-linux.org> | 2024-05-18 02:49:50 +0000 |
---|---|---|
committer | Daniel Baumann <daniel.baumann@progress-linux.org> | 2024-05-18 02:49:50 +0000 |
commit | 9835e2ae736235810b4ea1c162ca5e65c547e770 (patch) | |
tree | 3fcebf40ed70e581d776a8a4c65923e8ec20e026 /vendor/zerovec/src/varzerovec/vec.rs | |
parent | Releasing progress-linux version 1.70.0+dfsg2-1~progress7.99u1. (diff) | |
download | rustc-9835e2ae736235810b4ea1c162ca5e65c547e770.tar.xz rustc-9835e2ae736235810b4ea1c162ca5e65c547e770.zip |
Merging upstream version 1.71.1+dfsg1.
Signed-off-by: Daniel Baumann <daniel.baumann@progress-linux.org>
Diffstat (limited to 'vendor/zerovec/src/varzerovec/vec.rs')
-rw-r--r-- | vendor/zerovec/src/varzerovec/vec.rs | 10 |
1 files changed, 4 insertions, 6 deletions
diff --git a/vendor/zerovec/src/varzerovec/vec.rs b/vendor/zerovec/src/varzerovec/vec.rs index 7edb48a96..1401a180a 100644 --- a/vendor/zerovec/src/varzerovec/vec.rs +++ b/vendor/zerovec/src/varzerovec/vec.rs @@ -248,7 +248,7 @@ impl<'a, T: VarULE + ?Sized, F: VarZeroVecFormat> VarZeroVec<'a, T, F> { /// assert!(vzv.is_empty()); /// ``` #[inline] - pub fn new() -> Self { + pub const fn new() -> Self { Self::Borrowed(VarZeroSlice::new_empty()) } @@ -354,7 +354,7 @@ impl<'a, T: VarULE + ?Sized, F: VarZeroVecFormat> VarZeroVec<'a, T, F> { /// Obtain this `VarZeroVec` as a [`VarZeroSlice`] pub fn as_slice(&self) -> &VarZeroSlice<T, F> { match *self { - VarZeroVec::Owned(ref owned) => &**owned, + VarZeroVec::Owned(ref owned) => owned, VarZeroVec::Borrowed(b) => b, } } @@ -413,8 +413,7 @@ where { #[inline] fn from(elements: &Vec<A>) -> Self { - #[allow(clippy::unwrap_used)] // TODO(#1410) Better story for fallibility - VarZeroVecOwned::try_from_elements(elements).unwrap().into() + Self::from(elements.as_slice()) } } @@ -439,8 +438,7 @@ where { #[inline] fn from(elements: &[A; N]) -> Self { - #[allow(clippy::unwrap_used)] // TODO(#1410) Better story for fallibility - VarZeroVecOwned::try_from_elements(elements).unwrap().into() + Self::from(elements.as_slice()) } } |