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`
This commit is contained in:
commit
ae27c4ab1f
7 changed files with 19 additions and 42 deletions
|
@ -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())
|
||||
}
|
||||
}
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue