pageserver: add a const constructor for Key, for use in test consts

This commit is contained in:
John Spray
2023-09-11 17:09:46 +01:00
parent 412819ac20
commit 9a4f9a1b7c

View File

@@ -37,7 +37,7 @@ impl Key {
| self.field6 as i128
}
pub fn from_i128(x: i128) -> Self {
pub const fn from_i128(x: i128) -> Self {
Key {
field1: ((x >> 120) & 0xf) as u8,
field2: ((x >> 104) & 0xFFFF) as u32,