From 2b8abfcc9ae6133da3d59e91b3a58539459a1929 Mon Sep 17 00:00:00 2001 From: C0D3 M4513R <28912031+C0D3-M4513R@users.noreply.github.com> Date: Tue, 15 Aug 2023 12:52:29 +0200 Subject: [PATCH] Add Const fn's --- src/lib.rs | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/lib.rs b/src/lib.rs index d841965..51e934c 100644 --- a/src/lib.rs +++ b/src/lib.rs @@ -132,8 +132,8 @@ impl Default for CookieStoreMutex { impl CookieStoreMutex { /// Create a new [`CookieStoreMutex`] from an existing [`cookie_store::CookieStore`]. - pub fn new(cookie_store: CookieStore) -> CookieStoreMutex { - CookieStoreMutex(Mutex::new(cookie_store)) + pub const fn new(cookie_store: CookieStore) -> CookieStoreMutex { + CookieStoreMutex(Mutex::const_new(cookie_store)) } /// Lock and get a handle to the contained [`cookie_store::CookieStore`]. @@ -175,7 +175,7 @@ impl Default for CookieStoreRwLock { impl CookieStoreRwLock { /// Create a new [`CookieStoreRwLock`] from an existing [`cookie_store::CookieStore`]. - pub fn new(cookie_store: CookieStore) -> CookieStoreRwLock { + pub const fn new(cookie_store: CookieStore) -> CookieStoreRwLock { CookieStoreRwLock(RwLock::new(cookie_store)) }