diff options
| author | Ed Page <eopage@gmail.com> | 2023-09-01 19:33:16 -0500 |
|---|---|---|
| committer | Ed Page <eopage@gmail.com> | 2023-09-01 19:33:16 -0500 |
| commit | 30292bb68ec1a737df074449cbb9f4384065274a (patch) | |
| tree | 6dea19537ad6db5941bbbadb35c22a71778c3de4 /library/std/src/sys/common | |
| parent | 9aee1de612e55f03b24ab292e6c00c3b896b8493 (diff) | |
| download | rust-30292bb68ec1a737df074449cbb9f4384065274a.tar.gz rust-30292bb68ec1a737df074449cbb9f4384065274a.zip | |
fix(std): Rename os_str_bytes to encoded_bytes
Diffstat (limited to 'library/std/src/sys/common')
| -rw-r--r-- | library/std/src/sys/common/small_c_string.rs | 2 | ||||
| -rw-r--r-- | library/std/src/sys/common/tests.rs | 4 |
2 files changed, 3 insertions, 3 deletions
diff --git a/library/std/src/sys/common/small_c_string.rs b/library/std/src/sys/common/small_c_string.rs index 963d17a47e4..af9b18e372d 100644 --- a/library/std/src/sys/common/small_c_string.rs +++ b/library/std/src/sys/common/small_c_string.rs @@ -19,7 +19,7 @@ pub fn run_path_with_cstr<T, F>(path: &Path, f: F) -> io::Result<T> where F: FnOnce(&CStr) -> io::Result<T>, { - run_with_cstr(path.as_os_str().as_os_str_bytes(), f) + run_with_cstr(path.as_os_str().as_encoded_bytes(), f) } #[inline] diff --git a/library/std/src/sys/common/tests.rs b/library/std/src/sys/common/tests.rs index 0a1cbcbe8ef..32dc18ee1cf 100644 --- a/library/std/src/sys/common/tests.rs +++ b/library/std/src/sys/common/tests.rs @@ -8,7 +8,7 @@ use core::iter::repeat; fn stack_allocation_works() { let path = Path::new("abc"); let result = run_path_with_cstr(path, |p| { - assert_eq!(p, &*CString::new(path.as_os_str().as_os_str_bytes()).unwrap()); + assert_eq!(p, &*CString::new(path.as_os_str().as_encoded_bytes()).unwrap()); Ok(42) }); assert_eq!(result.unwrap(), 42); @@ -25,7 +25,7 @@ fn heap_allocation_works() { let path = repeat("a").take(384).collect::<String>(); let path = Path::new(&path); let result = run_path_with_cstr(path, |p| { - assert_eq!(p, &*CString::new(path.as_os_str().as_os_str_bytes()).unwrap()); + assert_eq!(p, &*CString::new(path.as_os_str().as_encoded_bytes()).unwrap()); Ok(42) }); assert_eq!(result.unwrap(), 42); |
