diff options
| author | Matthias Krüger <matthias.krueger@famsik.de> | 2022-02-24 07:48:09 +0100 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2022-02-24 07:48:09 +0100 |
| commit | ae27c4ab1f3c59eb81728425fbad4386e0a558bc (patch) | |
| tree | 38480c7e1d357b492a5d27ac599b39298b35e72f /compiler/rustc_data_structures | |
| parent | f3433d1b5962681b2e3ef733aeed4adaf9e6a47a (diff) | |
| parent | f1bcb0f3afb20e63f94bfff396f96027eecd0ad1 (diff) | |
Rollup merge of #94288 - Mark-Simulacrum:ser-opt, r=nnethercote
Cleanup a few Decoder methods This is just some simple follow up to #93839. r? `@nnethercote`
Diffstat (limited to 'compiler/rustc_data_structures')
| -rw-r--r-- | compiler/rustc_data_structures/src/fingerprint.rs | 4 |
1 files changed, 1 insertions, 3 deletions
diff --git a/compiler/rustc_data_structures/src/fingerprint.rs b/compiler/rustc_data_structures/src/fingerprint.rs index e931379dd3a..c88f3e73cff 100644 --- a/compiler/rustc_data_structures/src/fingerprint.rs +++ b/compiler/rustc_data_structures/src/fingerprint.rs @@ -153,9 +153,7 @@ impl<E: rustc_serialize::Encoder> Encodable<E> for Fingerprint { impl<D: rustc_serialize::Decoder> Decodable<D> for Fingerprint { #[inline] fn decode(d: &mut D) -> Self { - let mut bytes = [0u8; 16]; - d.read_raw_bytes_into(&mut bytes); - Fingerprint::from_le_bytes(bytes) + Fingerprint::from_le_bytes(d.read_raw_bytes(16).try_into().unwrap()) } } |
