Rollup merge of #60376 - lzutao:stabilize-option_xor, r=SimonSapin

Stabilize Option::xor

FCP done in https://github.com/rust-lang/rust/issues/50512#issuecomment-469527554 .

Closes #50512 .
This commit is contained in:
Mazdak Farrokhzad 2019-06-13 01:49:24 +02:00 committed by GitHub
commit b35aeae5b4
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -725,8 +725,6 @@ impl<T> Option<T> {
/// # Examples
///
/// ```
/// #![feature(option_xor)]
///
/// let x = Some(2);
/// let y: Option<u32> = None;
/// assert_eq!(x.xor(y), Some(2));
@ -744,7 +742,7 @@ impl<T> Option<T> {
/// assert_eq!(x.xor(y), None);
/// ```
#[inline]
#[unstable(feature = "option_xor", issue = "50512")]
#[stable(feature = "option_xor", since = "1.37.0")]
pub fn xor(self, optb: Option<T>) -> Option<T> {
match (self, optb) {
(Some(a), None) => Some(a),