Skip to content

Stabilize some stragglers in std::option #23771

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Mar 28, 2015
Merged

Conversation

aturon
Copy link
Member

@aturon aturon commented Mar 27, 2015

Marks as #[stable}:

  • ok_or
  • ok_or_else
  • iter_mut
  • cloned

Similarly to IteratorExt::cloned, the cloned method is pared down to
work only on Option<&T>. Thus, this is a:

[breaking-change]

r? @alexcrichton

Marks as `#[stable}`:

* `ok_or`
* `ok_or_else`
* `iter_mut`
* `cloned`

Similarly to `IteratorExt::cloned`, the `cloned` method is pared down to
work only on `Option<&T>`. Thus, this is a:

[breaking-change]
reason = "recently added as part of collections reform")]
impl<'a, T: Clone> Option<&'a T> {
/// Maps an Option<&T> to an Option<T> by cloning the contents of the Option.
#[stable(feature = "rust1", since = "1.0.0")]
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I haven't really felt the need to stabilize this in the past as it seems more niche than IteratorExt::cloned. Did you have some specific use-cases in mind?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

No burning need here. The motivation is exactly the same as for iterators.

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

(The fact that iterators have a stable version of this method, to me, justifies it as a somewhat conventional thing to provide, in that there's not much additional cognitive overhead here. YMMV)

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'm cool with that!

@alexcrichton
Copy link
Member

@bors: r+ c9f600b

alexcrichton added a commit to alexcrichton/rust that referenced this pull request Mar 27, 2015
Marks as `#[stable}`:

* `ok_or`
* `ok_or_else`
* `iter_mut`
* `cloned`

Similarly to `IteratorExt::cloned`, the `cloned` method is pared down to
work only on `Option<&T>`. Thus, this is a:

[breaking-change]

r? @alexcrichton
@bors bors merged commit c9f600b into rust-lang:master Mar 28, 2015
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants