From 0715803b7fdf6399f447f9fd2fdd2aa8b41beac7 Mon Sep 17 00:00:00 2001 From: Ryan Dahl Date: Tue, 15 Sep 2020 16:15:01 -0400 Subject: Remove http_client from CliState, store in OpState directly (#7497) --- cli/ops/fetch.rs | 12 +++++------- 1 file changed, 5 insertions(+), 7 deletions(-) (limited to 'cli/ops') diff --git a/cli/ops/fetch.rs b/cli/ops/fetch.rs index 7aece48da..4e4d35d50 100644 --- a/cli/ops/fetch.rs +++ b/cli/ops/fetch.rs @@ -51,9 +51,9 @@ async fn op_fetch( .ok_or_else(bad_resource_id)?; r.client.clone() } else { - let cli_state = super::cli_state2(&state); - let client_ref = cli_state.http_client.borrow(); - client_ref.clone() + let state_ = state.borrow(); + let client = state_.borrow::(); + client.clone() }; let method = match args.method { @@ -103,14 +103,12 @@ async fn op_fetch( ))), ); - let json_res = json!({ + Ok(json!({ "bodyRid": rid, "status": status.as_u16(), "statusText": status.canonical_reason().unwrap_or(""), "headers": res_headers - }); - - Ok(json_res) + })) } struct HttpClientResource { -- cgit v1.2.3