diff options
author | Daniel Baumann <daniel.baumann@progress-linux.org> | 2024-05-18 02:49:42 +0000 |
---|---|---|
committer | Daniel Baumann <daniel.baumann@progress-linux.org> | 2024-05-18 02:49:42 +0000 |
commit | 837b550238aa671a591ccf282dddeab29cadb206 (patch) | |
tree | 914b6b8862bace72bd3245ca184d374b08d8a672 /vendor/zerovec/src/varzerovec/components.rs | |
parent | Adding debian version 1.70.0+dfsg2-1. (diff) | |
download | rustc-837b550238aa671a591ccf282dddeab29cadb206.tar.xz rustc-837b550238aa671a591ccf282dddeab29cadb206.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/components.rs')
-rw-r--r-- | vendor/zerovec/src/varzerovec/components.rs | 7 |
1 files changed, 4 insertions, 3 deletions
diff --git a/vendor/zerovec/src/varzerovec/components.rs b/vendor/zerovec/src/varzerovec/components.rs index bf70c83c5..ff26d9029 100644 --- a/vendor/zerovec/src/varzerovec/components.rs +++ b/vendor/zerovec/src/varzerovec/components.rs @@ -85,7 +85,7 @@ unsafe impl VarZeroVecFormat for Index16 { unsafe impl VarZeroVecFormat for Index32 { const INDEX_WIDTH: usize = 4; - const MAX_VALUE: u32 = u32::MAX as u32; + const MAX_VALUE: u32 = u32::MAX; type RawBytes = RawBytesULE<4>; #[inline] fn rawbytes_to_usize(raw: Self::RawBytes) -> usize { @@ -110,6 +110,7 @@ unsafe impl VarZeroVecFormat for Index32 { /// exist. /// /// See [`VarZeroVecComponents::parse_byte_slice()`] for information on the internal invariants involved +#[derive(Debug)] pub struct VarZeroVecComponents<'a, T: ?Sized, F> { /// The number of elements len: u32, @@ -197,7 +198,7 @@ impl<'a, T: VarULE + ?Sized, F: VarZeroVecFormat> VarZeroVecComponents<'a, T, F> .ok_or(ZeroVecError::VarZeroVecFormatError)?; let borrowed = VarZeroVecComponents { - len: len as u32, + len, indices: indices_bytes, things, entire_slice: slice, @@ -392,7 +393,7 @@ impl<'a, T: VarULE + ?Sized, F: VarZeroVecFormat> VarZeroVecComponents<'a, T, F> .copied() .map(F::rawbytes_to_usize) .collect::<Vec<_>>(); - format!("VarZeroVecComponents {{ indices: {:?} }}", indices) + format!("VarZeroVecComponents {{ indices: {indices:?} }}") } } |