refactor/polish ~ fix cargo clippy complaints (unwrap_or_else)

This commit is contained in:
Roy Ivy III 2019-12-30 21:29:40 -06:00
parent b4866afb9a
commit daecc56d47

View file

@ -238,7 +238,7 @@ fn pretty(possible_pw: Option<Passwd>) {
#[cfg(any(target_os = "macos", target_os = "freebsd"))] #[cfg(any(target_os = "macos", target_os = "freebsd"))]
fn pline(possible_uid: Option<uid_t>) { fn pline(possible_uid: Option<uid_t>) {
let uid = possible_uid.unwrap_or(getuid()); let uid = possible_uid.unwrap_or_else(getuid);
let pw = Passwd::locate(uid).unwrap(); let pw = Passwd::locate(uid).unwrap();
println!( println!(