Skip to content

Commit cef5393

Browse files
committed
Fix clippy on nightly
1 parent 0922fd9 commit cef5393

File tree

1 file changed

+11
-11
lines changed

1 file changed

+11
-11
lines changed

src/unistd.rs

Lines changed: 11 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -2938,14 +2938,14 @@ impl From<&libc::passwd> for User {
29382938
fn from(pw: &libc::passwd) -> User {
29392939
unsafe {
29402940
User {
2941-
name: CStr::from_ptr((*pw).pw_name).to_string_lossy().into_owned(),
2942-
passwd: CString::new(CStr::from_ptr((*pw).pw_passwd).to_bytes()).unwrap(),
2941+
name: CStr::from_ptr(pw.pw_name).to_string_lossy().into_owned(),
2942+
passwd: CString::new(CStr::from_ptr(pw.pw_passwd).to_bytes()).unwrap(),
29432943
#[cfg(not(all(target_os = "android", target_pointer_width = "32")))]
2944-
gecos: CString::new(CStr::from_ptr((*pw).pw_gecos).to_bytes()).unwrap(),
2945-
dir: PathBuf::from(OsStr::from_bytes(CStr::from_ptr((*pw).pw_dir).to_bytes())),
2946-
shell: PathBuf::from(OsStr::from_bytes(CStr::from_ptr((*pw).pw_shell).to_bytes())),
2947-
uid: Uid::from_raw((*pw).pw_uid),
2948-
gid: Gid::from_raw((*pw).pw_gid),
2944+
gecos: CString::new(CStr::from_ptr(pw.pw_gecos).to_bytes()).unwrap(),
2945+
dir: PathBuf::from(OsStr::from_bytes(CStr::from_ptr(pw.pw_dir).to_bytes())),
2946+
shell: PathBuf::from(OsStr::from_bytes(CStr::from_ptr(pw.pw_shell).to_bytes())),
2947+
uid: Uid::from_raw(pw.pw_uid),
2948+
gid: Gid::from_raw(pw.pw_gid),
29492949
#[cfg(not(any(target_os = "android",
29502950
target_os = "fuchsia",
29512951
target_os = "haiku",
@@ -3123,10 +3123,10 @@ impl From<&libc::group> for Group {
31233123
fn from(gr: &libc::group) -> Group {
31243124
unsafe {
31253125
Group {
3126-
name: CStr::from_ptr((*gr).gr_name).to_string_lossy().into_owned(),
3127-
passwd: CString::new(CStr::from_ptr((*gr).gr_passwd).to_bytes()).unwrap(),
3128-
gid: Gid::from_raw((*gr).gr_gid),
3129-
mem: Group::members((*gr).gr_mem)
3126+
name: CStr::from_ptr(gr.gr_name).to_string_lossy().into_owned(),
3127+
passwd: CString::new(CStr::from_ptr(gr.gr_passwd).to_bytes()).unwrap(),
3128+
gid: Gid::from_raw(gr.gr_gid),
3129+
mem: Group::members(gr.gr_mem)
31303130
}
31313131
}
31323132
}

0 commit comments

Comments
 (0)