diff options
| author | bors <bors@rust-lang.org> | 2023-02-12 11:09:06 +0000 |
|---|---|---|
| committer | bors <bors@rust-lang.org> | 2023-02-12 11:09:06 +0000 |
| commit | adb4bfd25d3c1190b0e7433ef945221d8aeea427 (patch) | |
| tree | 506089b876ecb35668ca29ec5d0fcc122955c3fe /library/std/src/sys | |
| parent | 51cb5614dde163c53aab73e2dc33bb9f388b50a8 (diff) | |
| parent | 76e216f29b44322b52c49d8c56f20763beb271b5 (diff) | |
| download | rust-adb4bfd25d3c1190b0e7433ef945221d8aeea427.tar.gz rust-adb4bfd25d3c1190b0e7433ef945221d8aeea427.zip | |
Auto merge of #105671 - lukas-code:depreciate-char, r=scottmcm
Use associated items of `char` instead of freestanding items in `core::char`
The associated functions and constants on `char` have been stable since 1.52 and the freestanding items have soft-deprecated since 1.62 (https://github.com/rust-lang/rust/pull/95566). This PR ~~marks them as "deprecated in future", similar to the integer and floating point modules (`core::{i32, f32}` etc)~~ replaces all uses of `core::char::*` with `char::*` to prepare for future deprecation of `core::char::*`.
Diffstat (limited to 'library/std/src/sys')
| -rw-r--r-- | library/std/src/sys/windows/stdio.rs | 3 |
1 files changed, 1 insertions, 2 deletions
diff --git a/library/std/src/sys/windows/stdio.rs b/library/std/src/sys/windows/stdio.rs index 70c9b14a08f..c2cd48470bd 100644 --- a/library/std/src/sys/windows/stdio.rs +++ b/library/std/src/sys/windows/stdio.rs @@ -1,6 +1,5 @@ #![unstable(issue = "none", feature = "windows_stdio")] -use crate::char::decode_utf16; use crate::cmp; use crate::io; use crate::mem::MaybeUninit; @@ -369,7 +368,7 @@ fn read_u16s(handle: c::HANDLE, buf: &mut [MaybeUninit<u16>]) -> io::Result<usiz #[allow(unused)] fn utf16_to_utf8(utf16: &[u16], utf8: &mut [u8]) -> io::Result<usize> { let mut written = 0; - for chr in decode_utf16(utf16.iter().cloned()) { + for chr in char::decode_utf16(utf16.iter().cloned()) { match chr { Ok(chr) => { chr.encode_utf8(&mut utf8[written..]); |
