Skip to content

Commit

Permalink
remove unneeded clone()
Browse files Browse the repository at this point in the history
  • Loading branch information
dwrensha committed Sep 25, 2024
1 parent fd04db5 commit 9bf527e
Showing 1 changed file with 2 additions and 4 deletions.
6 changes: 2 additions & 4 deletions capnp-rpc/src/rpc.rs
Original file line number Diff line number Diff line change
Expand Up @@ -1488,8 +1488,6 @@ impl<VatId> ConnectionState<VatId> {
}

fn import(state: &Rc<Self>, import_id: ImportId, is_promise: bool) -> Box<dyn ClientHook> {
let connection_state = state.clone();

let import_client = {
match state.imports.borrow_mut().slots.entry(import_id) {
hash_map::Entry::Occupied(occ) => occ
Expand All @@ -1498,7 +1496,7 @@ impl<VatId> ConnectionState<VatId> {
.upgrade()
.expect("dangling ref to import client?"),
hash_map::Entry::Vacant(v) => {
let import_client = ImportClient::new(&connection_state, import_id);
let import_client = ImportClient::new(state, import_id);
v.insert(Import::new(&import_client));
import_client
}
Expand Down Expand Up @@ -1535,7 +1533,7 @@ impl<VatId> ConnectionState<VatId> {
// PromiseClient holds `client` until it resolves, after which point
// there is no reason to keep the import alive.

let client = PromiseClient::new(&connection_state, client, Some(import_id));
let client = PromiseClient::new(state, client, Some(import_id));

import.promise_client_to_resolve = Some(Rc::downgrade(&client));
let client: Box<Client<VatId>> = Box::new(client.into());
Expand Down

0 comments on commit 9bf527e

Please sign in to comment.