From 51c60b8507f8ac91b828155a4ab591af1d905627 Mon Sep 17 00:00:00 2001 From: "Tobin C. Harding" Date: Wed, 25 May 2022 13:46:56 +1000 Subject: [PATCH] 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. --- src/consensus/encode.rs | 1 + 1 file changed, 1 insertion(+) diff --git a/src/consensus/encode.rs b/src/consensus/encode.rs index 6505df37..b8e04034 100644 --- a/src/consensus/encode.rs +++ b/src/consensus/encode.rs @@ -359,6 +359,7 @@ impl_int_encodable!(i16, read_i16, emit_i16); impl_int_encodable!(i32, read_i32, emit_i32); impl_int_encodable!(i64, read_i64, emit_i64); +#[allow(clippy::len_without_is_empty)] // VarInt has on concept of 'is_empty'. impl VarInt { /// Gets the length of this VarInt when encoded. /// Returns 1 for 0..=0xFC, 3 for 0xFD..=(2^16-1), 5 for 0x10000..=(2^32-1),