-
Notifications
You must be signed in to change notification settings - Fork 12.8k
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
Deprecate the AsciiExt trait in favor of inherent methods #49109
Conversation
fa731b7
to
dbc0c43
Compare
@@ -143,8 +142,6 @@ macro_rules! assert_all { | |||
stringify!($what), b); | |||
} | |||
} | |||
assert!($str.$what()); | |||
assert!($str.as_bytes().$what()); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
These methods are removed on str
and [u8]
in favor of explicit Iterator::all
: #39658 (comment)
@bors: r+ |
📌 Commit dbc0c43 has been approved by |
@bors r- Failed to build stage0-std on Windows.
|
The trait and some of its methods are stable and will remain. Some of the newer methods are unstable and can be removed later. Fixes rust-lang#39658
I had turned a trait impl into inherent methods, but forgot to make them public. Additional diff squashed into the commit just now: diff --git a/src/libstd/sys_common/wtf8.rs b/src/libstd/sys_common/wtf8.rs
index 175107bdc4..78b2bb5fe6 100644
--- a/src/libstd/sys_common/wtf8.rs
+++ b/src/libstd/sys_common/wtf8.rs
@@ -871,21 +871,21 @@ impl Hash for Wtf8 {
}
impl Wtf8 {
- fn is_ascii(&self) -> bool {
+ pub fn is_ascii(&self) -> bool {
self.bytes.is_ascii()
}
- fn to_ascii_uppercase(&self) -> Wtf8Buf {
+ pub fn to_ascii_uppercase(&self) -> Wtf8Buf {
Wtf8Buf { bytes: self.bytes.to_ascii_uppercase() }
}
- fn to_ascii_lowercase(&self) -> Wtf8Buf {
+ pub fn to_ascii_lowercase(&self) -> Wtf8Buf {
Wtf8Buf { bytes: self.bytes.to_ascii_lowercase() }
}
- fn eq_ignore_ascii_case(&self, other: &Wtf8) -> bool {
+ pub fn eq_ignore_ascii_case(&self, other: &Wtf8) -> bool {
self.bytes.eq_ignore_ascii_case(&other.bytes)
}
- fn make_ascii_uppercase(&mut self) { self.bytes.make_ascii_uppercase() }
- fn make_ascii_lowercase(&mut self) { self.bytes.make_ascii_lowercase() }
+ pub fn make_ascii_uppercase(&mut self) { self.bytes.make_ascii_uppercase() }
+ pub fn make_ascii_lowercase(&mut self) { self.bytes.make_ascii_lowercase() }
}
#[cfg(test)] |
dbc0c43
to
c09b9f9
Compare
@bors: r=alexcrichton |
📌 Commit c09b9f9 has been approved by |
🌲 The tree is currently closed for pull requests below priority 30, this pull request will be tested once the tree is reopened |
…excrichton Deprecate the AsciiExt trait in favor of inherent methods The trait and some of its methods are stable and will remain. Some of the newer methods are unstable and can be removed later. Fixes rust-lang#39658
…excrichton Deprecate the AsciiExt trait in favor of inherent methods The trait and some of its methods are stable and will remain. Some of the newer methods are unstable and can be removed later. Fixes rust-lang#39658
The trait and some of its methods are stable and will remain.
Some of the newer methods are unstable and can be removed later.
Fixes #39658