summaryrefslogtreecommitdiff
path: root/core/ops_builtin.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 /core/ops_builtin.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 'core/ops_builtin.rs')
-rw-r--r--core/ops_builtin.rs6
1 files changed, 3 insertions, 3 deletions
diff --git a/core/ops_builtin.rs b/core/ops_builtin.rs
index 1cc1e8d34..d225b8624 100644
--- a/core/ops_builtin.rs
+++ b/core/ops_builtin.rs
@@ -108,7 +108,7 @@ pub fn op_metrics(state: &mut OpState) -> (OpMetrics, Vec<OpMetrics>) {
/// Builtin utility to print to stdout/stderr
#[op]
-pub fn op_print(msg: String, is_err: bool) -> Result<(), Error> {
+pub fn op_print(msg: &str, is_err: bool) -> Result<(), Error> {
if is_err {
stderr().write_all(msg.as_bytes())?;
stderr().flush().unwrap();
@@ -153,12 +153,12 @@ pub fn op_wasm_streaming_feed(
pub fn op_wasm_streaming_set_url(
state: &mut OpState,
rid: ResourceId,
- url: String,
+ url: &str,
) -> Result<(), Error> {
let wasm_streaming =
state.resource_table.get::<WasmStreamingResource>(rid)?;
- wasm_streaming.0.borrow_mut().set_url(&url);
+ wasm_streaming.0.borrow_mut().set_url(url);
Ok(())
}