Skip to content

Commit

Permalink
Merge #441
Browse files Browse the repository at this point in the history
441: fix borrowing warning on nightly r=MarkMcCaskey a=MarkMcCaskey

resolves #433 

Co-authored-by: Mark McCaskey <mark@wasmer.io>
  • Loading branch information
bors[bot] and MarkMcCaskey committed May 14, 2019
2 parents 702a3fd + 5114d42 commit 9120723
Showing 1 changed file with 6 additions and 8 deletions.
14 changes: 6 additions & 8 deletions lib/wasi/src/syscalls/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -788,15 +788,13 @@ pub fn fd_renumber(ctx: &mut Ctx, from: __wasi_fd_t, to: __wasi_fd_t) -> __wasi_
debug!("wasi::fd_renumber: from={}, to={}", from, to);
let state = get_wasi_state(ctx);
let fd_entry = wasi_try!(state.fs.fd_map.get(&from).ok_or(__WASI_EBADF));
let new_fd_entry = Fd {
// TODO: verify this is correct
rights: fd_entry.rights_inheriting,
..*fd_entry
};

state.fs.fd_map.insert(
to,
Fd {
// TODO: verify this is correct
rights: fd_entry.rights_inheriting,
..*fd_entry
},
);
state.fs.fd_map.insert(to, new_fd_entry);
__WASI_ESUCCESS
}

Expand Down

0 comments on commit 9120723

Please sign in to comment.