summaryrefslogtreecommitdiffstats
path: root/library/core/src/char
diff options
context:
space:
mode:
authorDaniel Baumann <daniel.baumann@progress-linux.org>2024-06-07 05:48:48 +0000
committerDaniel Baumann <daniel.baumann@progress-linux.org>2024-06-07 05:48:48 +0000
commitef24de24a82fe681581cc130f342363c47c0969a (patch)
tree0d494f7e1a38b95c92426f58fe6eaa877303a86c /library/core/src/char
parentReleasing progress-linux version 1.74.1+dfsg1-1~progress7.99u1. (diff)
downloadrustc-ef24de24a82fe681581cc130f342363c47c0969a.tar.xz
rustc-ef24de24a82fe681581cc130f342363c47c0969a.zip
Merging upstream version 1.75.0+dfsg1.
Signed-off-by: Daniel Baumann <daniel.baumann@progress-linux.org>
Diffstat (limited to 'library/core/src/char')
-rw-r--r--library/core/src/char/decode.rs4
-rw-r--r--library/core/src/char/methods.rs9
2 files changed, 10 insertions, 3 deletions
diff --git a/library/core/src/char/decode.rs b/library/core/src/char/decode.rs
index dbfe251f2..23319fbe5 100644
--- a/library/core/src/char/decode.rs
+++ b/library/core/src/char/decode.rs
@@ -2,6 +2,7 @@
use crate::error::Error;
use crate::fmt;
+use crate::iter::FusedIterator;
/// An iterator that decodes UTF-16 encoded code points from an iterator of `u16`s.
///
@@ -105,6 +106,9 @@ impl<I: Iterator<Item = u16>> Iterator for DecodeUtf16<I> {
}
}
+#[stable(feature = "decode_utf16_fused_iterator", since = "1.75.0")]
+impl<I: Iterator<Item = u16> + FusedIterator> FusedIterator for DecodeUtf16<I> {}
+
impl DecodeUtf16Error {
/// Returns the unpaired surrogate which caused this error.
#[must_use]
diff --git a/library/core/src/char/methods.rs b/library/core/src/char/methods.rs
index 4ac956e7b..7ce33bdd4 100644
--- a/library/core/src/char/methods.rs
+++ b/library/core/src/char/methods.rs
@@ -1450,7 +1450,7 @@ impl char {
#[rustc_const_stable(feature = "const_ascii_ctype_on_intrinsics", since = "1.47.0")]
#[inline]
pub const fn is_ascii_alphanumeric(&self) -> bool {
- matches!(*self, '0'..='9' | 'A'..='Z' | 'a'..='z')
+ matches!(*self, '0'..='9') | matches!(*self, 'A'..='Z') | matches!(*self, 'a'..='z')
}
/// Checks if the value is an ASCII decimal digit:
@@ -1553,7 +1553,7 @@ impl char {
#[rustc_const_stable(feature = "const_ascii_ctype_on_intrinsics", since = "1.47.0")]
#[inline]
pub const fn is_ascii_hexdigit(&self) -> bool {
- matches!(*self, '0'..='9' | 'A'..='F' | 'a'..='f')
+ matches!(*self, '0'..='9') | matches!(*self, 'A'..='F') | matches!(*self, 'a'..='f')
}
/// Checks if the value is an ASCII punctuation character:
@@ -1591,7 +1591,10 @@ impl char {
#[rustc_const_stable(feature = "const_ascii_ctype_on_intrinsics", since = "1.47.0")]
#[inline]
pub const fn is_ascii_punctuation(&self) -> bool {
- matches!(*self, '!'..='/' | ':'..='@' | '['..='`' | '{'..='~')
+ matches!(*self, '!'..='/')
+ | matches!(*self, ':'..='@')
+ | matches!(*self, '['..='`')
+ | matches!(*self, '{'..='~')
}
/// Checks if the value is an ASCII graphic character: