From ede1a5d5edcebe28f98057d915ae4602378354dc Mon Sep 17 00:00:00 2001 From: Ben Berman Date: Tue, 10 Jul 2018 13:26:44 -0400 Subject: [PATCH] Amend option.take examples It wasn't abundantly clear to me what `.take` returned. Perhaps this is a slightly frivolous change, but I think it's an improvement. =) Apologies if I'm not following proper procedures. --- src/libcore/option.rs | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/src/libcore/option.rs b/src/libcore/option.rs index 20bc173f7e154..c219a9fb52131 100644 --- a/src/libcore/option.rs +++ b/src/libcore/option.rs @@ -833,12 +833,14 @@ impl Option { /// /// ``` /// let mut x = Some(2); - /// x.take(); + /// let y = x.take(); /// assert_eq!(x, None); + /// assert_eq!(y, Some(2)); /// /// let mut x: Option = None; - /// x.take(); + /// let y = x.take(); /// assert_eq!(x, None); + /// assert_eq!(y, None); /// ``` #[inline] #[stable(feature = "rust1", since = "1.0.0")]