about summary refs log tree commit diff
path: root/compiler/rustc_serialize/tests
diff options
context:
space:
mode:
authorNicholas Nethercote <n.nethercote@gmail.com>2022-06-16 16:00:25 +1000
committerNicholas Nethercote <n.nethercote@gmail.com>2022-06-16 16:20:32 +1000
commitbb02cc47c49ee3cc1e913c243d69ee7cb23df598 (patch)
tree957f4eb12de558ee321f9a012c4cd1468c54b34d /compiler/rustc_serialize/tests
parentca983054e19afd74d63c3ed37997f3bf30fe85d0 (diff)
downloadrust-bb02cc47c49ee3cc1e913c243d69ee7cb23df598.tar.gz
rust-bb02cc47c49ee3cc1e913c243d69ee7cb23df598.zip
Move `finish` out of the `Encoder` trait.
This simplifies things, but requires making `CacheEncoder` non-generic.

(This was previously merged as commit 4 in #94732 and then was reverted
in #97905 because it caused a perf regression.)
Diffstat (limited to 'compiler/rustc_serialize/tests')
-rw-r--r--compiler/rustc_serialize/tests/opaque.rs4
1 files changed, 2 insertions, 2 deletions
diff --git a/compiler/rustc_serialize/tests/opaque.rs b/compiler/rustc_serialize/tests/opaque.rs
index 4eafb6fabde..3a695d0714e 100644
--- a/compiler/rustc_serialize/tests/opaque.rs
+++ b/compiler/rustc_serialize/tests/opaque.rs
@@ -2,7 +2,7 @@
 
 use rustc_macros::{Decodable, Encodable};
 use rustc_serialize::opaque::{MemDecoder, MemEncoder};
-use rustc_serialize::{Decodable, Encodable, Encoder as EncoderTrait};
+use rustc_serialize::{Decodable, Encodable};
 use std::fmt::Debug;
 
 #[derive(PartialEq, Clone, Debug, Encodable, Decodable)]
@@ -38,7 +38,7 @@ fn check_round_trip<
         Encodable::encode(value, &mut encoder);
     }
 
-    let data = encoder.finish().unwrap();
+    let data = encoder.finish();
     let mut decoder = MemDecoder::new(&data[..], 0);
 
     for value in values {