From 4ac959a3c083dcd3c6536c26513b26ff891abfe6 Mon Sep 17 00:00:00 2001 From: Nicholas Nethercote Date: Thu, 4 May 2023 12:55:01 +1000 Subject: [PATCH] Rename `file_encoder_write_leb128!`. `MemEncoder` was recently removed, leaving `FileEncoder` as the only encoder. So this prefix is no longer needed, and `write_leb128!` matches the existing `read_leb128!`. --- compiler/rustc_serialize/src/opaque.rs | 18 +++++++++--------- 1 file changed, 9 insertions(+), 9 deletions(-) diff --git a/compiler/rustc_serialize/src/opaque.rs b/compiler/rustc_serialize/src/opaque.rs index bb722b9ad66..dc78f1da745 100644 --- a/compiler/rustc_serialize/src/opaque.rs +++ b/compiler/rustc_serialize/src/opaque.rs @@ -265,7 +265,7 @@ fn drop(&mut self) { } } -macro_rules! file_encoder_write_leb128 { +macro_rules! write_leb128 { ($enc:expr, $value:expr, $int_ty:ty, $fun:ident) => {{ const MAX_ENCODED_LEN: usize = $crate::leb128::max_leb128_len::<$int_ty>(); @@ -294,22 +294,22 @@ macro_rules! file_encoder_write_leb128 { impl Encoder for FileEncoder { #[inline] fn emit_usize(&mut self, v: usize) { - file_encoder_write_leb128!(self, v, usize, write_usize_leb128) + write_leb128!(self, v, usize, write_usize_leb128) } #[inline] fn emit_u128(&mut self, v: u128) { - file_encoder_write_leb128!(self, v, u128, write_u128_leb128) + write_leb128!(self, v, u128, write_u128_leb128) } #[inline] fn emit_u64(&mut self, v: u64) { - file_encoder_write_leb128!(self, v, u64, write_u64_leb128) + write_leb128!(self, v, u64, write_u64_leb128) } #[inline] fn emit_u32(&mut self, v: u32) { - file_encoder_write_leb128!(self, v, u32, write_u32_leb128) + write_leb128!(self, v, u32, write_u32_leb128) } #[inline] @@ -324,22 +324,22 @@ fn emit_u8(&mut self, v: u8) { #[inline] fn emit_isize(&mut self, v: isize) { - file_encoder_write_leb128!(self, v, isize, write_isize_leb128) + write_leb128!(self, v, isize, write_isize_leb128) } #[inline] fn emit_i128(&mut self, v: i128) { - file_encoder_write_leb128!(self, v, i128, write_i128_leb128) + write_leb128!(self, v, i128, write_i128_leb128) } #[inline] fn emit_i64(&mut self, v: i64) { - file_encoder_write_leb128!(self, v, i64, write_i64_leb128) + write_leb128!(self, v, i64, write_i64_leb128) } #[inline] fn emit_i32(&mut self, v: i32) { - file_encoder_write_leb128!(self, v, i32, write_i32_leb128) + write_leb128!(self, v, i32, write_i32_leb128) } #[inline]