Skip to content

Commit 2e781a2

Browse files
committed
Use ref instead of mut
1 parent 0a59f50 commit 2e781a2

File tree

2 files changed

+5
-5
lines changed

2 files changed

+5
-5
lines changed

ntex-rt/Cargo.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
[package]
22
name = "ntex-rt"
3-
version = "3.8.0"
3+
version = "3.8.1"
44
authors = ["ntex contributors <team@ntex.rs>"]
55
description = "ntex runtime"
66
keywords = ["network", "framework", "async", "futures"]

ntex-rt/src/arbiter.rs

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -427,13 +427,13 @@ pub fn set_item<T: 'static>(item: T) {
427427
/// Get a reference to a type previously inserted on this runtime's storage
428428
pub fn get_item<T: 'static, F, R>(f: F) -> R
429429
where
430-
F: FnOnce(Option<&mut T>) -> R,
430+
F: FnOnce(Option<&T>) -> R,
431431
{
432432
STORAGE.with(move |cell| {
433-
let mut st = cell.borrow_mut();
433+
let st = cell.borrow();
434434
let item = st
435-
.get_mut(&TypeId::of::<T>())
436-
.and_then(|boxed| boxed.downcast_mut());
435+
.get(&TypeId::of::<T>())
436+
.and_then(|boxed| boxed.downcast_ref());
437437
f(item)
438438
})
439439
}

0 commit comments

Comments
 (0)