Skip to content

Commit 6880772

Browse files
committed
Allow no is_empty method for VarInt
Clippy emits: warning: struct `VarInt` has a public `len` method, but no `is_empty` method However, `VarInt` has no concept of 'is empty' so add a compiler directive to allow the lint.
1 parent 2c2ad95 commit 6880772

File tree

1 file changed

+1
-0
lines changed

1 file changed

+1
-0
lines changed

src/consensus/encode.rs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -359,6 +359,7 @@ impl_int_encodable!(i16, read_i16, emit_i16);
359359
impl_int_encodable!(i32, read_i32, emit_i32);
360360
impl_int_encodable!(i64, read_i64, emit_i64);
361361

362+
#[allow(clippy::len_without_is_empty)] // VarInt has on concept of 'is_empty'.
362363
impl VarInt {
363364
/// Gets the length of this VarInt when encoded.
364365
/// Returns 1 for 0..=0xFC, 3 for 0xFD..=(2^16-1), 5 for 0x10000..=(2^32-1),

0 commit comments

Comments
 (0)