diff options
author | Aaron O'Mullan <aaron.omullan@gmail.com> | 2022-05-13 12:53:13 +0200 |
---|---|---|
committer | GitHub <noreply@github.com> | 2022-05-13 12:53:13 +0200 |
commit | 67e5a850cc9b37b76638cfbac9dee08286a3469a (patch) | |
tree | 6e8f3f93ba54f572173fb9d0fb588173157c941c /ext/http/lib.rs | |
parent | 3e7afb8918fd0f6cedf839a7ebaae6aaee5e66ad (diff) |
feat(serde_v8): bytes::Bytes support (#14412)
Diffstat (limited to 'ext/http/lib.rs')
-rw-r--r-- | ext/http/lib.rs | 7 |
1 files changed, 2 insertions, 5 deletions
diff --git a/ext/http/lib.rs b/ext/http/lib.rs index e34d4b80f..d1d884457 100644 --- a/ext/http/lib.rs +++ b/ext/http/lib.rs @@ -589,10 +589,7 @@ fn http_response( Some(data) => { // If a buffer was passed, but isn't compressible, we use it to // construct a response body. - Ok(( - HttpResponseWriter::Closed, - Bytes::copy_from_slice(&data).into(), - )) + Ok((HttpResponseWriter::Closed, Bytes::from(data).into())) } None if compressing => { // Create a one way pipe that implements tokio's async io traits. To do @@ -766,7 +763,7 @@ async fn op_http_write( } } HttpResponseWriter::BodyUncompressed(body) => { - let bytes = Bytes::copy_from_slice(&buf[..]); + let bytes = Bytes::from(buf); match body.send_data(bytes).await { Ok(_) => Ok(()), Err(err) => { |