Skip to content

Commit 8cfc530

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

File tree

1 file changed

+14
-14
lines changed

1 file changed

+14
-14
lines changed

src/unistd.rs

Lines changed: 14 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -2938,35 +2938,35 @@ 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",
29522952
target_os = "illumos",
29532953
target_os = "linux",
29542954
target_os = "solaris")))]
2955-
class: CString::new(CStr::from_ptr((*pw).pw_class).to_bytes()).unwrap(),
2955+
class: CString::new(CStr::from_ptr(pw.pw_class).to_bytes()).unwrap(),
29562956
#[cfg(not(any(target_os = "android",
29572957
target_os = "fuchsia",
29582958
target_os = "haiku",
29592959
target_os = "illumos",
29602960
target_os = "linux",
29612961
target_os = "solaris")))]
2962-
change: (*pw).pw_change,
2962+
change: pw.pw_change,
29632963
#[cfg(not(any(target_os = "android",
29642964
target_os = "fuchsia",
29652965
target_os = "haiku",
29662966
target_os = "illumos",
29672967
target_os = "linux",
29682968
target_os = "solaris")))]
2969-
expire: (*pw).pw_expire
2969+
expire: pw.pw_expire
29702970
}
29712971
}
29722972
}
@@ -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)