From 79e066fc95c036e64716a4222c580782a9c932c2 Mon Sep 17 00:00:00 2001 From: Samrat Man Singh Date: Mon, 3 Aug 2020 20:39:09 +0530 Subject: [PATCH] Remove unnecessary `clone()` on `writable` --- src/shims/posix/fs.rs | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/shims/posix/fs.rs b/src/shims/posix/fs.rs index 6f46401ece6..1bba30a1ea0 100644 --- a/src/shims/posix/fs.rs +++ b/src/shims/posix/fs.rs @@ -411,13 +411,13 @@ fn fcntl( let fh = &mut this.machine.file_handler; let (file_result, writable) = match fh.handles.get(&fd) { Some(file_descriptor) => match file_descriptor.as_file_handle() { - Ok(FileHandle { file, writable }) => (file.try_clone(), writable.clone()), + Ok(FileHandle { file, writable }) => (file.try_clone(), *writable), Err(_) => return this.handle_not_found(), }, None => return this.handle_not_found(), }; let fd_result = file_result.map(|duplicated| { - fh.insert_fd_with_min_fd(FileHandle { file: duplicated, writable: writable }, start) + fh.insert_fd_with_min_fd(FileHandle { file: duplicated, writable }, start) }); this.try_unwrap_io_result(fd_result) } else if this.tcx.sess.target.target.target_os == "macos" -- 2.44.0