Skip to content

Commit

Permalink
chore: fix clippy warnings
Browse files Browse the repository at this point in the history
  • Loading branch information
Rexagon committed Nov 6, 2024
1 parent b661c9d commit 99ac0ed
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 6 deletions.
4 changes: 4 additions & 0 deletions src/abi/ty.rs
Original file line number Diff line number Diff line change
Expand Up @@ -202,7 +202,9 @@ impl std::borrow::Borrow<WithoutName<AbiType>> for WithoutName<NamedAbiType> {
/// An iterator that flattens the first-level tuple.
#[derive(Clone)]
pub enum NamedAbiTypeFlatten {
#[doc(hidden)]
Single(Option<NamedAbiType>),
#[doc(hidden)]
Tuple(Vec<NamedAbiType>),
}

Expand Down Expand Up @@ -765,7 +767,9 @@ impl Hash for WithoutName<AbiType> {
/// An iterator that flattens the first-level tuple.
#[derive(Clone)]
pub enum AbiTypeFlatten {
#[doc(hidden)]
Single(Option<AbiType>),
#[doc(hidden)]
Tuple(Vec<NamedAbiType>),
}

Expand Down
12 changes: 6 additions & 6 deletions src/dict/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -510,12 +510,12 @@ fn write_label_parts(
let hml_long_len = 2 + bits_for_len + remaining_bits;
let hml_same_len = 3 + bits_for_len;

if hml_same_len < hml_long_len && hml_same_len < hml_short_len {
if pfx.is_data_empty() || matches!(pfx.test_uniform(), Some(p) if p == bit) {
if rem.is_data_empty() || matches!(rem.test_uniform(), Some(r) if r == bit) {
return write_hml_same(bit, remaining_bits, bits_for_len, label);
}
}
if hml_same_len < hml_long_len
&& hml_same_len < hml_short_len
&& (pfx.is_data_empty() || matches!(pfx.test_uniform(), Some(p) if p == bit))
&& (rem.is_data_empty() || matches!(rem.test_uniform(), Some(r) if r == bit))
{
return write_hml_same(bit, remaining_bits, bits_for_len, label);
}

if hml_short_len <= MAX_BIT_LEN && hml_short_len <= hml_long_len {
Expand Down

0 comments on commit 99ac0ed

Please sign in to comment.