1
Fork 0

Rename rustc_serialize::opaque::Encoder as MemEncoder.

This avoids the name clash with `rustc_serialize::Encoder` (a trait),
and allows lots qualifiers to be removed and imports to be simplified
(e.g. fewer `as` imports).

(This was previously merged as commit 5 in #94732 and then was reverted
in #97905 because of a perf regression caused by commit 4 in #94732.)
This commit is contained in:
Nicholas Nethercote 2022-06-14 14:52:01 +10:00
parent ca122c7ebb
commit abe45a9ffa
22 changed files with 124 additions and 141 deletions

View file

@ -1911,13 +1911,13 @@ impl_pos! {
pub struct CharPos(pub usize);
}
impl<S: rustc_serialize::Encoder> Encodable<S> for BytePos {
impl<S: Encoder> Encodable<S> for BytePos {
fn encode(&self, s: &mut S) {
s.emit_u32(self.0);
}
}
impl<D: rustc_serialize::Decoder> Decodable<D> for BytePos {
impl<D: Decoder> Decodable<D> for BytePos {
fn decode(d: &mut D) -> BytePos {
BytePos(d.read_u32())
}