about summary refs log tree commit diff
path: root/src/libcore/nonzero.rs
diff options
context:
space:
mode:
Diffstat (limited to 'src/libcore/nonzero.rs')
-rw-r--r--src/libcore/nonzero.rs13
1 files changed, 4 insertions, 9 deletions
diff --git a/src/libcore/nonzero.rs b/src/libcore/nonzero.rs
index d7382501bc3..d93085e96db 100644
--- a/src/libcore/nonzero.rs
+++ b/src/libcore/nonzero.rs
@@ -13,7 +13,7 @@
             reason = "needs an RFC to flesh out the design",
             issue = "27730")]
 
-use ops::{CoerceUnsized, Deref};
+use ops::CoerceUnsized;
 
 /// Unsafe trait to indicate what types are usable with the NonZero struct
 pub unsafe trait Zeroable {}
@@ -46,15 +46,10 @@ impl<T: Zeroable> NonZero<T> {
     pub const unsafe fn new(inner: T) -> NonZero<T> {
         NonZero(inner)
     }
-}
-
-impl<T: Zeroable> Deref for NonZero<T> {
-    type Target = T;
 
-    #[inline]
-    fn deref(&self) -> &T {
-        let NonZero(ref inner) = *self;
-        inner
+    /// Gets the inner value.
+    pub fn get(self) -> T {
+        self.0
     }
 }