From b6eb830bf47fa2756766a171dd9a947e81b57722 Mon Sep 17 00:00:00 2001 From: Mackenzie Clark Date: Wed, 27 Mar 2019 16:14:29 -0700 Subject: [PATCH] Revert "impl From for EmscriptenVfsError" This reverts commit 18eae44577a0291b2d2bda84f429b4ffd80ac359. --- lib/emscripten/src/syscalls/emscripten_vfs.rs | 10 +++------- 1 file changed, 3 insertions(+), 7 deletions(-) diff --git a/lib/emscripten/src/syscalls/emscripten_vfs.rs b/lib/emscripten/src/syscalls/emscripten_vfs.rs index 0e6bbcd00..b9e8a9439 100644 --- a/lib/emscripten/src/syscalls/emscripten_vfs.rs +++ b/lib/emscripten/src/syscalls/emscripten_vfs.rs @@ -102,7 +102,9 @@ impl EmscriptenVfs { match self.fd_map.get(&fd) { Some(FileHandle::Vf(file)) => { let mut mut_ref = RefCell::borrow_mut(file); - mut_ref.write_file(buf_slice, 0).into() + mut_ref + .write_file(buf_slice, 0) + .map_err(|e| EmscriptenVfsError::Io(e)) } Some(FileHandle::Socket(host_fd)) => unsafe { let result = libc::write(*host_fd, buf_slice.as_ptr() as _, count as _); @@ -147,9 +149,3 @@ pub enum EmscriptenVfsError { Errno(errno::Errno), FileSystemError, } - -impl From for EmscriptenVfsError { - fn from(io_error: io::Error) -> Self { - EmscriptenVfsError::Io(io_error) - } -}