diff options
| author | bors <bors@rust-lang.org> | 2024-04-26 17:41:24 +0000 |
|---|---|---|
| committer | bors <bors@rust-lang.org> | 2024-04-26 17:41:24 +0000 |
| commit | 4d570eea025a19564429eb52b34ec34e14659f55 (patch) | |
| tree | a265caa89ea72bd1b354e734fe629ed4f88e90a8 /library/alloc/src/string.rs | |
| parent | 1b3a32958bb54bde45e693217e8f7469459e5865 (diff) | |
| parent | 61cf00464e311b3dcf1a47b342c57978b1f40d88 (diff) | |
Auto merge of #123909 - dtolnay:utf8chunks, r=joboet
Stabilize `Utf8Chunks` Pending FCP in https://github.com/rust-lang/rust/issues/99543. This PR includes the proposed modification in https://github.com/rust-lang/libs-team/issues/190 as agreed in https://github.com/rust-lang/rust/issues/99543#issuecomment-2050406568.
Diffstat (limited to 'library/alloc/src/string.rs')
| -rw-r--r-- | library/alloc/src/string.rs | 4 |
1 files changed, 1 insertions, 3 deletions
diff --git a/library/alloc/src/string.rs b/library/alloc/src/string.rs index 082af1447ec..7c9f13e30ff 100644 --- a/library/alloc/src/string.rs +++ b/library/alloc/src/string.rs @@ -58,8 +58,6 @@ use core::ops::{self, Range, RangeBounds}; use core::ptr; use core::slice; use core::str::pattern::Pattern; -#[cfg(not(no_global_oom_handling))] -use core::str::Utf8Chunks; #[cfg(not(no_global_oom_handling))] use crate::borrow::{Cow, ToOwned}; @@ -633,7 +631,7 @@ impl String { #[cfg(not(no_global_oom_handling))] #[stable(feature = "rust1", since = "1.0.0")] pub fn from_utf8_lossy(v: &[u8]) -> Cow<'_, str> { - let mut iter = Utf8Chunks::new(v); + let mut iter = v.utf8_chunks(); let first_valid = if let Some(chunk) = iter.next() { let valid = chunk.valid(); |
