Skip to content

Commit c4025fa

Browse files
committed
opti(rwlock): make new a const fn
1 parent c4db0bf commit c4025fa

File tree

2 files changed

+2
-2
lines changed

2 files changed

+2
-2
lines changed

async-rwlock/Cargo.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@ categories = ["asynchronous", "concurrency"]
1313
readme = "../README.md"
1414

1515
[dependencies]
16-
async-mutex = "1.1.5"
16+
async-mutex = { path = "../async-mutex", version = "1.4.0" }
1717
event-listener = "2.4.0"
1818

1919
[dev-dependencies]

async-rwlock/src/lib.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -101,7 +101,7 @@ impl<T> RwLock<T> {
101101
///
102102
/// let lock = RwLock::new(0);
103103
/// ```
104-
pub fn new(t: T) -> RwLock<T> {
104+
pub const fn new(t: T) -> RwLock<T> {
105105
RwLock {
106106
mutex: Mutex::new(()),
107107
no_readers: Event::new(),

0 commit comments

Comments
 (0)