Skip to content

Commit 51312dd

Browse files
committed
style: remove unnecessary mut and unsafe keywords
Compiler nagged about these. Remove it to please the compiler.
1 parent 8e19f50 commit 51312dd

File tree

1 file changed

+4
-4
lines changed

1 file changed

+4
-4
lines changed

src/lib.rs

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
// Original work Copyright (c) 2014 The Rust Project Developers
2-
// Modified work Copyright (c) 2016-2017 Nikita Pekin and the lazycell contributors
2+
// Modified work Copyright (c) 2016-2018 Nikita Pekin and the lazycell contributors
33
// See the README.md file at the top-level directory of this distribution.
44
//
55
// Licensed under the Apache License, Version 2.0 <LICENSE-APACHE or
@@ -63,7 +63,7 @@ impl<T> LazyCell<T> {
6363
///
6464
/// This function will return `Err(value)` is the cell is already full.
6565
pub fn fill(&self, value: T) -> Result<(), T> {
66-
let mut slot = unsafe { &mut *self.inner.get() };
66+
let slot = unsafe { &mut *self.inner.get() };
6767
if slot.is_some() {
6868
return Err(value);
6969
}
@@ -135,7 +135,7 @@ impl<T> LazyCell<T> {
135135

136136
/// Consumes this `LazyCell`, returning the underlying value.
137137
pub fn into_inner(self) -> Option<T> {
138-
unsafe { self.inner.into_inner() }
138+
self.inner.into_inner()
139139
}
140140
}
141141

@@ -206,7 +206,7 @@ impl<T> AtomicLazyCell<T> {
206206

207207
/// Consumes this `LazyCell`, returning the underlying value.
208208
pub fn into_inner(self) -> Option<T> {
209-
unsafe { self.inner.into_inner() }
209+
self.inner.into_inner()
210210
}
211211
}
212212

0 commit comments

Comments
 (0)