diff --git a/CHANGELOG.md b/CHANGELOG.md index ec5652d..95da44f 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -8,6 +8,10 @@ and this project adheres to [Semantic Versioning](http://semver.org/). # [unreleased] +## Changed + +- `UnsignedByteField` and `GenericUnsignedByteField` `new` methods are `const` now. + # [v0.7.0-beta.0] 2023-08-16 - Moved MSRV from v1.60 to v1.61. diff --git a/src/util.rs b/src/util.rs index 3fd41dc..4a71ea0 100644 --- a/src/util.rs +++ b/src/util.rs @@ -123,7 +123,7 @@ pub struct UnsignedByteField { } impl UnsignedByteField { - pub fn new(width: usize, value: u64) -> Self { + pub const fn new(width: usize, value: u64) -> Self { Self { width, value } } @@ -204,7 +204,7 @@ pub struct GenericUnsignedByteField { } impl GenericUnsignedByteField { - pub fn new(val: TYPE) -> Self { + pub const fn new(val: TYPE) -> Self { Self { value: val } } }