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!`.
This commit is contained in:
parent
6b70be2a34
commit
4ac959a3c0
1 changed files with 9 additions and 9 deletions
|
@ -265,7 +265,7 @@ impl Drop for FileEncoder {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
macro_rules! file_encoder_write_leb128 {
|
macro_rules! write_leb128 {
|
||||||
($enc:expr, $value:expr, $int_ty:ty, $fun:ident) => {{
|
($enc:expr, $value:expr, $int_ty:ty, $fun:ident) => {{
|
||||||
const MAX_ENCODED_LEN: usize = $crate::leb128::max_leb128_len::<$int_ty>();
|
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 {
|
impl Encoder for FileEncoder {
|
||||||
#[inline]
|
#[inline]
|
||||||
fn emit_usize(&mut self, v: usize) {
|
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]
|
#[inline]
|
||||||
fn emit_u128(&mut self, v: u128) {
|
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]
|
#[inline]
|
||||||
fn emit_u64(&mut self, v: u64) {
|
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]
|
#[inline]
|
||||||
fn emit_u32(&mut self, v: u32) {
|
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]
|
#[inline]
|
||||||
|
@ -324,22 +324,22 @@ impl Encoder for FileEncoder {
|
||||||
|
|
||||||
#[inline]
|
#[inline]
|
||||||
fn emit_isize(&mut self, v: isize) {
|
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]
|
#[inline]
|
||||||
fn emit_i128(&mut self, v: i128) {
|
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]
|
#[inline]
|
||||||
fn emit_i64(&mut self, v: i64) {
|
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]
|
#[inline]
|
||||||
fn emit_i32(&mut self, v: i32) {
|
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]
|
#[inline]
|
||||||
|
|
Loading…
Add table
Reference in a new issue