Skip to content

Commit

Permalink
Rollup merge of rust-lang#60376 - lzutao:stabilize-option_xor, r=Simo…
Browse files Browse the repository at this point in the history
…nSapin

Stabilize Option::xor

FCP done in rust-lang#50512 (comment) .

Closes rust-lang#50512 .
  • Loading branch information
Centril committed Jun 12, 2019
2 parents 2887008 + 1fa50b3 commit b35aeae
Showing 1 changed file with 1 addition and 3 deletions.
4 changes: 1 addition & 3 deletions src/libcore/option.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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));
Expand All @@ -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),
Expand Down

0 comments on commit b35aeae

Please sign in to comment.