about summary refs log tree commit diff
path: root/compiler/rustc_data_structures
diff options
context:
space:
mode:
authorMatthias Krüger <matthias.krueger@famsik.de>2022-02-24 07:48:09 +0100
committerGitHub <noreply@github.com>2022-02-24 07:48:09 +0100
commitae27c4ab1f3c59eb81728425fbad4386e0a558bc (patch)
tree38480c7e1d357b492a5d27ac599b39298b35e72f /compiler/rustc_data_structures
parentf3433d1b5962681b2e3ef733aeed4adaf9e6a47a (diff)
parentf1bcb0f3afb20e63f94bfff396f96027eecd0ad1 (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.rs4
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())
     }
 }