From fc50acae90ea11a43eb247f0249b676645c3d434 Mon Sep 17 00:00:00 2001 From: David Carlier Date: Sun, 23 Jun 2024 09:56:02 +0100 Subject: [PATCH] fix build --- library/std/src/sys/pal/unix/os.rs | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/library/std/src/sys/pal/unix/os.rs b/library/std/src/sys/pal/unix/os.rs index 3e690ce60d2b2..40e2d1403ef5e 100644 --- a/library/std/src/sys/pal/unix/os.rs +++ b/library/std/src/sys/pal/unix/os.rs @@ -748,8 +748,7 @@ pub fn home_dir() -> Option { &mut result, ) { 0 if !result.is_null() => { - let passwd = p.assume_init(); - let ptr = passwd.pw_dir as *const _; + let ptr = (*result).pw_dir as *const _; let bytes = CStr::from_ptr(ptr).to_bytes().to_vec(); Some(OsStringExt::from_vec(bytes)) }