Skip to content

Commit

Permalink
Merge #212: hrp len const fn
Browse files Browse the repository at this point in the history
72ad45a hrp len const fn (Tomáš Zemanovič)

Pull request description:

  makes the `Hrp::len` a const fn

ACKs for top commit:
  clarkmoody:
    ACK 72ad45a
  apoelstra:
    ACK 72ad45a; successfully ran local tests

Tree-SHA512: 8e5181d02f8e85b3b91bb877a2f0afb1561ffd3ec18fabf13da808d59926bea1fe24c8291e078f10a5eecaddab8b5e1f98dee03e84c6e472751d2dd2ceb1d424
  • Loading branch information
apoelstra committed Feb 9, 2025
2 parents ab33fb7 + 72ad45a commit a19e843
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/primitives/hrp.rs
Original file line number Diff line number Diff line change
Expand Up @@ -263,7 +263,7 @@ impl Hrp {
/// Guaranteed to be between 1 and 83 inclusive.
#[inline]
#[allow(clippy::len_without_is_empty)] // HRP is never empty.
pub fn len(&self) -> usize { self.size }
pub const fn len(&self) -> usize { self.size }

/// Returns `true` if this HRP is valid according to the bips.
///
Expand Down

0 comments on commit a19e843

Please sign in to comment.