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.
This commit is contained in:
Ben Berman 2018-07-10 13:26:44 -04:00 committed by GitHub
parent fc491526dd
commit ede1a5d5ed
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -833,12 +833,14 @@ impl<T> Option<T> {
///
/// ```
/// let mut x = Some(2);
/// x.take();
/// let y = x.take();
/// assert_eq!(x, None);
/// assert_eq!(y, Some(2));
///
/// let mut x: Option<u32> = None;
/// x.take();
/// let y = x.take();
/// assert_eq!(x, None);
/// assert_eq!(y, None);
/// ```
#[inline]
#[stable(feature = "rust1", since = "1.0.0")]