From ed0c0be54babd756287d30dce4d572aadf0b26d9 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Sosth=C3=A8ne=20Gu=C3=A9don?= Date: Thu, 20 Jun 2024 10:16:42 +0200 Subject: [PATCH] Make ByteArray::new and ByteArray::into_array const --- src/bytearray.rs | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/bytearray.rs b/src/bytearray.rs index 91202d8..f6a05e0 100644 --- a/src/bytearray.rs +++ b/src/bytearray.rs @@ -42,12 +42,12 @@ pub struct ByteArray { impl ByteArray { /// Wrap an existing [array] into a `ByteArray`. - pub fn new(bytes: [u8; N]) -> Self { + pub const fn new(bytes: [u8; N]) -> Self { ByteArray { bytes } } /// Unwrap the byte array underlying this `ByteArray`. - pub fn into_array(self) -> [u8; N] { + pub const fn into_array(self) -> [u8; N] { self.bytes }