Merge rust-bitcoin/rust-bitcoin#1072: Make `opcode::to_u8` a const function

0bae41129d Make `opcode::to_u8` a const function (Matt Corallo)

Pull request description:

  In general, if a function can be const, it should be, and this one
  trivially can be, so it should be.

ACKs for top commit:
  tcharding:
    ACK 0bae41129d
  apoelstra:
    ACK 0bae41129d

Tree-SHA512: 0df883894ec65dac1b709c581ffc3d2daca737561d05adb971dfef736e4147c59ea66cdc0520296c619e13e1dac70c07cb062b61304541cf488262244f313009
This commit is contained in:
Andrew Poelstra 2022-06-28 23:15:15 +00:00
commit 8084d6dd42
No known key found for this signature in database
GPG Key ID: C588D63CE41B97C1
1 changed files with 1 additions and 1 deletions

View File

@ -743,7 +743,7 @@ impl All {
/// Encodes [`All`] as a byte. /// Encodes [`All`] as a byte.
#[inline] #[inline]
pub fn to_u8(self) -> u8 { pub const fn to_u8(self) -> u8 {
self.code self.code
} }
} }