Skip to content

Commit 30010de

Browse files
committed
Fix clippy on nightly
1 parent bd64fd5 commit 30010de

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
@@ -2903,32 +2903,32 @@ impl From<&libc::passwd> for User {
29032903
fn from(pw: &libc::passwd) -> User {
29042904
unsafe {
29052905
User {
2906-
name: CStr::from_ptr((*pw).pw_name).to_string_lossy().into_owned(),
2907-
passwd: CString::new(CStr::from_ptr((*pw).pw_passwd).to_bytes()).unwrap(),
2906+
name: CStr::from_ptr(pw.pw_name).to_string_lossy().into_owned(),
2907+
passwd: CString::new(CStr::from_ptr(pw.pw_passwd).to_bytes()).unwrap(),
29082908
#[cfg(not(all(target_os = "android", target_pointer_width = "32")))]
2909-
gecos: CString::new(CStr::from_ptr((*pw).pw_gecos).to_bytes()).unwrap(),
2910-
dir: PathBuf::from(OsStr::from_bytes(CStr::from_ptr((*pw).pw_dir).to_bytes())),
2911-
shell: PathBuf::from(OsStr::from_bytes(CStr::from_ptr((*pw).pw_shell).to_bytes())),
2912-
uid: Uid::from_raw((*pw).pw_uid),
2913-
gid: Gid::from_raw((*pw).pw_gid),
2909+
gecos: CString::new(CStr::from_ptr(pw.pw_gecos).to_bytes()).unwrap(),
2910+
dir: PathBuf::from(OsStr::from_bytes(CStr::from_ptr(pw.pw_dir).to_bytes())),
2911+
shell: PathBuf::from(OsStr::from_bytes(CStr::from_ptr(pw.pw_shell).to_bytes())),
2912+
uid: Uid::from_raw(pw.pw_uid),
2913+
gid: Gid::from_raw(pw.pw_gid),
29142914
#[cfg(not(any(target_os = "android",
29152915
target_os = "fuchsia",
29162916
target_os = "illumos",
29172917
target_os = "linux",
29182918
target_os = "solaris")))]
2919-
class: CString::new(CStr::from_ptr((*pw).pw_class).to_bytes()).unwrap(),
2919+
class: CString::new(CStr::from_ptr(pw.pw_class).to_bytes()).unwrap(),
29202920
#[cfg(not(any(target_os = "android",
29212921
target_os = "fuchsia",
29222922
target_os = "illumos",
29232923
target_os = "linux",
29242924
target_os = "solaris")))]
2925-
change: (*pw).pw_change,
2925+
change: pw.pw_change,
29262926
#[cfg(not(any(target_os = "android",
29272927
target_os = "fuchsia",
29282928
target_os = "illumos",
29292929
target_os = "linux",
29302930
target_os = "solaris")))]
2931-
expire: (*pw).pw_expire
2931+
expire: pw.pw_expire
29322932
}
29332933
}
29342934
}
@@ -3082,10 +3082,10 @@ impl From<&libc::group> for Group {
30823082
fn from(gr: &libc::group) -> Group {
30833083
unsafe {
30843084
Group {
3085-
name: CStr::from_ptr((*gr).gr_name).to_string_lossy().into_owned(),
3086-
passwd: CString::new(CStr::from_ptr((*gr).gr_passwd).to_bytes()).unwrap(),
3087-
gid: Gid::from_raw((*gr).gr_gid),
3088-
mem: Group::members((*gr).gr_mem)
3085+
name: CStr::from_ptr(gr.gr_name).to_string_lossy().into_owned(),
3086+
passwd: CString::new(CStr::from_ptr(gr.gr_passwd).to_bytes()).unwrap(),
3087+
gid: Gid::from_raw(gr.gr_gid),
3088+
mem: Group::members(gr.gr_mem)
30893089
}
30903090
}
30913091
}

0 commit comments

Comments
 (0)