Skip to content

Commit 6f89b71

Browse files
committed
Merge rust-bitcoin/rust-bitcoin#1072: Make opcode::to_u8 a const function
0bae411 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 0bae411 apoelstra: ACK 0bae411 Tree-SHA512: 0df883894ec65dac1b709c581ffc3d2daca737561d05adb971dfef736e4147c59ea66cdc0520296c619e13e1dac70c07cb062b61304541cf488262244f313009
2 parents 48cc8c1 + 05d41c1 commit 6f89b71

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

src/blockdata/opcodes.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -743,7 +743,7 @@ impl All {
743743

744744
/// Encodes [`All`] as a byte.
745745
#[inline]
746-
pub fn to_u8(self) -> u8 {
746+
pub const fn to_u8(self) -> u8 {
747747
self.code
748748
}
749749
}

0 commit comments

Comments
 (0)