Skip to content
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

Tweak some stabilizations in libstd #50088

Merged
merged 1 commit into from
Apr 20, 2018
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions src/liballoc/btree/map.rs
Original file line number Diff line number Diff line change
Expand Up @@ -2155,8 +2155,8 @@ impl<'a, K: Ord, V> Entry<'a, K, V> {
/// assert_eq!(map["poneyland"], 43);
/// ```
#[stable(feature = "entry_and_modify", since = "1.26.0")]
pub fn and_modify<F>(self, mut f: F) -> Self
where F: FnMut(&mut V)
pub fn and_modify<F>(self, f: F) -> Self
where F: FnOnce(&mut V)
{
match self {
Occupied(mut entry) => {
Expand Down
42 changes: 0 additions & 42 deletions src/liballoc/str.rs
Original file line number Diff line number Diff line change
Expand Up @@ -2140,48 +2140,6 @@ impl str {
unsafe { String::from_utf8_unchecked(buf) }
}

/// Returns true if this `str` is entirely whitespace, and false otherwise.
///
/// 'Whitespace' is defined according to the terms of the Unicode Derived Core
/// Property `White_Space`.
///
/// # Examples
///
/// Basic usage:
///
/// ```
/// assert!(" \t ".is_whitespace());
///
/// // a non-breaking space
/// assert!("\u{A0}".is_whitespace());
///
/// assert!(!" 越".is_whitespace());
/// ```
#[stable(feature = "unicode_methods_on_intrinsics", since = "1.27.0")]
#[inline]
pub fn is_whitespace(&self) -> bool {
Copy link
Member

Choose a reason for hiding this comment

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

Should we be destabilizing and deprecating these for a bit? Not sure if they've been around and unstable previously.

Copy link
Member Author

Choose a reason for hiding this comment

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

I'd be ok with that as well yeah, or perhaps just reverting these to unstable? I'm fine either way, they were added insta-stable in #49381 and haven't been around for all that long so I don't think we need too too much process

Copy link
Member

Choose a reason for hiding this comment

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

Oh cool if they're new then it seems fine to just remove.

StrExt::is_whitespace(self)
}

/// Returns true if this `str` is entirely alphanumeric, and false otherwise.
///
/// 'Alphanumeric'-ness is defined in terms of the Unicode General Categories
/// 'Nd', 'Nl', 'No' and the Derived Core Property 'Alphabetic'.
///
/// # Examples
///
/// Basic usage:
///
/// ```
/// assert!("٣7৬Kو藏".is_alphanumeric());
/// assert!(!"¾①".is_alphanumeric());
/// ```
#[stable(feature = "unicode_methods_on_intrinsics", since = "1.27.0")]
#[inline]
pub fn is_alphanumeric(&self) -> bool {
StrExt::is_alphanumeric(self)
}

/// Checks if all characters in this string are within the ASCII range.
///
/// # Examples
Expand Down
2 changes: 1 addition & 1 deletion src/librustdoc/test.rs
Original file line number Diff line number Diff line change
Expand Up @@ -437,7 +437,7 @@ fn partition_source(s: &str) -> (String, String) {

for line in s.lines() {
let trimline = line.trim();
let header = trimline.is_whitespace() ||
let header = trimline.chars().all(|c| c.is_whitespace()) ||
trimline.starts_with("#![") ||
trimline.starts_with("#[macro_use] extern crate") ||
trimline.starts_with("extern crate");
Expand Down
4 changes: 2 additions & 2 deletions src/libstd/collections/hash/map.rs
Original file line number Diff line number Diff line change
Expand Up @@ -2127,8 +2127,8 @@ impl<'a, K, V> Entry<'a, K, V> {
/// assert_eq!(map["poneyland"], 43);
/// ```
#[stable(feature = "entry_and_modify", since = "1.26.0")]
pub fn and_modify<F>(self, mut f: F) -> Self
where F: FnMut(&mut V)
pub fn and_modify<F>(self, f: F) -> Self
where F: FnOnce(&mut V)
{
match self {
Occupied(mut entry) => {
Expand Down