From c2f6cde25d68e7903603a2406d6dea1be75107e5 Mon Sep 17 00:00:00 2001 From: Andrew Walbran Date: Wed, 12 Jun 2024 12:05:41 +0100 Subject: [PATCH] Volatile test initialisers can be const. --- src/volatile.rs | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/volatile.rs b/src/volatile.rs index b7059d13..84751357 100644 --- a/src/volatile.rs +++ b/src/volatile.rs @@ -5,7 +5,7 @@ pub struct ReadOnly(T); impl ReadOnly { /// Construct a new instance for testing. - pub fn new(value: T) -> Self { + pub const fn new(value: T) -> Self { Self(value) } } @@ -22,7 +22,7 @@ pub struct Volatile(T); impl Volatile { /// Construct a new instance for testing. - pub fn new(value: T) -> Self { + pub const fn new(value: T) -> Self { Self(value) } }