Skip to content

Commit 79e066f

Browse files
committed
Remove unnecessary clone() on writable
1 parent 3386f12 commit 79e066f

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

src/shims/posix/fs.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -411,13 +411,13 @@ pub trait EvalContextExt<'mir, 'tcx: 'mir>: crate::MiriEvalContextExt<'mir, 'tcx
411411
let fh = &mut this.machine.file_handler;
412412
let (file_result, writable) = match fh.handles.get(&fd) {
413413
Some(file_descriptor) => match file_descriptor.as_file_handle() {
414-
Ok(FileHandle { file, writable }) => (file.try_clone(), writable.clone()),
414+
Ok(FileHandle { file, writable }) => (file.try_clone(), *writable),
415415
Err(_) => return this.handle_not_found(),
416416
},
417417
None => return this.handle_not_found(),
418418
};
419419
let fd_result = file_result.map(|duplicated| {
420-
fh.insert_fd_with_min_fd(FileHandle { file: duplicated, writable: writable }, start)
420+
fh.insert_fd_with_min_fd(FileHandle { file: duplicated, writable }, start)
421421
});
422422
this.try_unwrap_io_result(fd_result)
423423
} else if this.tcx.sess.target.target.target_os == "macos"

0 commit comments

Comments
 (0)