From 6f908079cff6974bf34d6322073e68e4a4b0b247 Mon Sep 17 00:00:00 2001 From: Marcin Mielniczuk Date: Thu, 2 Apr 2020 19:08:10 +0200 Subject: [PATCH] Remove an unnecessary error mapping --- crates/wasi-common/src/sys/windows/path.rs | 24 +--------------------- 1 file changed, 1 insertion(+), 23 deletions(-) diff --git a/crates/wasi-common/src/sys/windows/path.rs b/crates/wasi-common/src/sys/windows/path.rs index b544ce8881a2..a1cc06ce31be 100644 --- a/crates/wasi-common/src/sys/windows/path.rs +++ b/crates/wasi-common/src/sys/windows/path.rs @@ -184,29 +184,7 @@ pub(crate) fn link( _ => e.into(), })?; } - fs::hard_link(&old_path, &new_path).or_else(|err| { - match err.raw_os_error() { - Some(code) => { - debug!("path_link at fs::hard_link error code={:?}", code); - match code as u32 { - // TODO is this needed at all???? - winerror::ERROR_ACCESS_DENIED => { - // does the target exist? - if new_path.exists() { - return Err(Errno::Exist); - } - } - _ => {} - } - - Err(err.into()) - } - None => { - log::debug!("Inconvertible OS error: {}", err); - Err(Errno::Io) - } - } - }) + fs::hard_link(&old_path, &new_path).map_err(Into::into) } pub(crate) fn open(