From 0bae41129d71ede804ab9dffc5bc4d39f64aa4f6 Mon Sep 17 00:00:00 2001 From: Matt Corallo Date: Tue, 28 Jun 2022 17:48:31 +0000 Subject: [PATCH] Make `opcode::to_u8` a const function In general, if a function can be const, it should be, and this one trivially can be, so it should be. --- src/blockdata/opcodes.rs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/blockdata/opcodes.rs b/src/blockdata/opcodes.rs index 33e626f0..9462410d 100644 --- a/src/blockdata/opcodes.rs +++ b/src/blockdata/opcodes.rs @@ -743,7 +743,7 @@ impl All { /// Encodes [`All`] as a byte. #[inline] - pub fn to_u8(self) -> u8 { + pub const fn to_u8(self) -> u8 { self.code } }