Skip to content

Commit 220217a

Browse files
committed
redundant_closure
1 parent b962ae1 commit 220217a

File tree

3 files changed

+4
-4
lines changed

3 files changed

+4
-4
lines changed

library/std/src/sys/windows/api.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -132,7 +132,7 @@ pub fn set_file_information_by_handle<T: SetFileInformation>(
132132
size: u32,
133133
) -> Result<(), WinError> {
134134
let result = c::SetFileInformationByHandle(handle, class, info, size);
135-
(result != 0).then_some(()).ok_or_else(|| get_last_error())
135+
(result != 0).then_some(()).ok_or_else(get_last_error)
136136
}
137137
// SAFETY: The `SetFileInformation` trait ensures that this is safe.
138138
unsafe { set_info(handle, T::CLASS, info.as_ptr(), info.size()) }

library/std/src/sys/windows/os.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -297,7 +297,7 @@ pub fn getenv(k: &OsStr) -> Option<OsString> {
297297
let k = to_u16s(k).ok()?;
298298
super::fill_utf16_buf(
299299
|buf, sz| unsafe { c::GetEnvironmentVariableW(k.as_ptr(), buf, sz) },
300-
|buf| OsStringExt::from_wide(buf),
300+
OsStringExt::from_wide,
301301
)
302302
.ok()
303303
}
@@ -356,7 +356,7 @@ pub fn home_dir() -> Option<PathBuf> {
356356
crate::env::var_os("HOME")
357357
.or_else(|| crate::env::var_os("USERPROFILE"))
358358
.map(PathBuf::from)
359-
.or_else(|| home_dir_crt())
359+
.or_else(home_dir_crt)
360360
}
361361

362362
pub fn exit(code: i32) -> ! {

library/std/src/sys/windows/process.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -245,7 +245,7 @@ impl Command {
245245
}
246246

247247
pub fn get_current_dir(&self) -> Option<&Path> {
248-
self.cwd.as_ref().map(|cwd| Path::new(cwd))
248+
self.cwd.as_ref().map(Path::new)
249249
}
250250

251251
pub unsafe fn raw_attribute<T: Copy + Send + Sync + 'static>(

0 commit comments

Comments
 (0)