We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 99abdfa commit 8a3797bCopy full SHA for 8a3797b
src/libcore/option.rs
@@ -845,7 +845,7 @@ impl<T> Option<T> {
845
#[inline]
846
#[stable(feature = "rust1", since = "1.0.0")]
847
pub fn take(&mut self) -> Option<T> {
848
- mem::replace(self, None)
+ mem::take(self)
849
}
850
851
/// Replaces the actual value in the option by the value given in parameter,
src/libproc_macro/bridge/buffer.rs
@@ -78,7 +78,7 @@ impl<T: Copy> Buffer<T> {
78
79
80
pub(super) fn take(&mut self) -> Self {
81
- mem::replace(self, Self::default())
82
83
84
pub(super) fn extend_from_slice(&mut self, xs: &[T]) {
0 commit comments