summaryrefslogtreecommitdiff
path: root/ext/web/compression.rs
diff options
context:
space:
mode:
authorDivy Srivastava <dj.srivastava23@gmail.com>2023-03-03 19:04:10 +0530
committerGitHub <noreply@github.com>2023-03-03 19:04:10 +0530
commit38555a6a0fe9a7235776afe0ebfb2a24dc518391 (patch)
treeef9506c500451e5f2ef4ae5b70eda85c7147a25e /ext/web/compression.rs
parent64503fabd81e38c58d44d23ae94f5b87a384b86e (diff)
feat(ops): reland fast zero copy string arguments (#17996)
Reland https://github.com/denoland/deno/pull/16777 The codegen is disabled in async ops and when fallback to slow call is possible (return type is a Result) to avoid hitting this V8 bug: https://github.com/denoland/deno/issues/17159
Diffstat (limited to 'ext/web/compression.rs')
-rw-r--r--ext/web/compression.rs4
1 files changed, 2 insertions, 2 deletions
diff --git a/ext/web/compression.rs b/ext/web/compression.rs
index ee129fe5a..11ea9196a 100644
--- a/ext/web/compression.rs
+++ b/ext/web/compression.rs
@@ -41,11 +41,11 @@ impl Resource for CompressionResource {
#[op]
pub fn op_compression_new(
state: &mut OpState,
- format: String,
+ format: &str,
is_decoder: bool,
) -> ResourceId {
let w = Vec::new();
- let inner = match (format.as_str(), is_decoder) {
+ let inner = match (format, is_decoder) {
("deflate", true) => Inner::DeflateDecoder(ZlibDecoder::new(w)),
("deflate", false) => {
Inner::DeflateEncoder(ZlibEncoder::new(w, Compression::default()))