1
Fork 0
mirror of https://github.com/RGBCube/uutils-coreutils synced 2025-08-01 13:37:48 +00:00

unwrap_or_else can be an unwrap_or

This commit is contained in:
electricboogie 2021-04-25 12:58:04 -05:00
parent 5e378717d2
commit 2f37b85426

View file

@ -1063,7 +1063,7 @@ pub fn uumain(args: impl uucore::Args) -> i32 {
let result = matches let result = matches
.value_of(OPT_TMP_DIR) .value_of(OPT_TMP_DIR)
.map(String::from) .map(String::from)
.unwrap_or_else(|| DEFAULT_TMPDIR.to_owned()); .unwrap_or(DEFAULT_TMPDIR.to_owned());
settings.tmp_dir = PathBuf::from(result); settings.tmp_dir = PathBuf::from(result);
} else { } else {
for (key, value) in env::vars_os() { for (key, value) in env::vars_os() {