diff options
| -rw-r--r-- | src/libcore/option.rs | 2 | ||||
| -rw-r--r-- | src/libproc_macro/bridge/buffer.rs | 2 |
2 files changed, 2 insertions, 2 deletions
diff --git a/src/libcore/option.rs b/src/libcore/option.rs index eec4b149ddc..a2eff0200b7 100644 --- a/src/libcore/option.rs +++ b/src/libcore/option.rs @@ -845,7 +845,7 @@ impl<T> Option<T> { #[inline] #[stable(feature = "rust1", since = "1.0.0")] pub fn take(&mut self) -> Option<T> { - mem::replace(self, None) + mem::take(self) } /// Replaces the actual value in the option by the value given in parameter, diff --git a/src/libproc_macro/bridge/buffer.rs b/src/libproc_macro/bridge/buffer.rs index 0d8cc552d61..a51e3a9a33d 100644 --- a/src/libproc_macro/bridge/buffer.rs +++ b/src/libproc_macro/bridge/buffer.rs @@ -78,7 +78,7 @@ impl<T: Copy> Buffer<T> { } pub(super) fn take(&mut self) -> Self { - mem::replace(self, Self::default()) + mem::take(self) } pub(super) fn extend_from_slice(&mut self, xs: &[T]) { |
