Add `const` modifier to `Magic::from_bytes`

Resolves: rust-bitcoin/rust-bitcoin#2814
This commit is contained in:
Velnbur 2024-05-30 12:58:29 +03:00
parent b0870634f0
commit b7458256af
No known key found for this signature in database
1 changed files with 1 additions and 1 deletions

View File

@ -223,7 +223,7 @@ impl Magic {
pub const REGTEST: Self = Self([0xFA, 0xBF, 0xB5, 0xDA]); pub const REGTEST: Self = Self([0xFA, 0xBF, 0xB5, 0xDA]);
/// Create network magic from bytes. /// Create network magic from bytes.
pub fn from_bytes(bytes: [u8; 4]) -> Magic { Magic(bytes) } pub const fn from_bytes(bytes: [u8; 4]) -> Magic { Magic(bytes) }
/// Get network magic bytes. /// Get network magic bytes.
pub fn to_bytes(self) -> [u8; 4] { self.0 } pub fn to_bytes(self) -> [u8; 4] { self.0 }