From 4258ed262f6eed9b0ee123e1ba9c91f999f0b429 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Bartek=20Iwa=C5=84czuk?= Date: Tue, 31 Dec 2019 15:09:58 +0100 Subject: refactor: move HttpBody to cli/http_util.rs (#3569) --- cli/ops/fetch.rs | 6 ++---- cli/ops/io.rs | 2 +- 2 files changed, 3 insertions(+), 5 deletions(-) (limited to 'cli/ops') diff --git a/cli/ops/fetch.rs b/cli/ops/fetch.rs index 9db8d68be..2787b5b7f 100644 --- a/cli/ops/fetch.rs +++ b/cli/ops/fetch.rs @@ -1,13 +1,11 @@ // Copyright 2018-2019 the Deno authors. All rights reserved. MIT license. use super::dispatch_json::{Deserialize, JsonOp, Value}; use super::io::StreamResource; -use crate::http_body::HttpBody; -use crate::http_util::get_client; +use crate::http_util::{get_client, HttpBody}; use crate::ops::json_op; use crate::state::ThreadSafeState; use deno::*; use futures::future::FutureExt; -use futures::StreamExt; use http::header::HeaderName; use http::header::HeaderValue; use http::Method; @@ -66,7 +64,7 @@ pub fn op_fetch( res_headers.push((key.to_string(), val.to_str().unwrap().to_owned())); } - let body = HttpBody::from(res.bytes_stream().boxed()); + let body = HttpBody::from(res); let mut table = state_.lock_resource_table(); let rid = table.add( "httpBody", diff --git a/cli/ops/io.rs b/cli/ops/io.rs index f268adc03..1d832a70e 100644 --- a/cli/ops/io.rs +++ b/cli/ops/io.rs @@ -1,7 +1,7 @@ use super::dispatch_minimal::MinimalOp; use crate::deno_error; use crate::deno_error::bad_resource; -use crate::http_body::HttpBody; +use crate::http_util::HttpBody; use crate::ops::minimal_op; use crate::state::ThreadSafeState; use deno::ErrBox; -- cgit v1.2.3