From 6afdcf59b80b4a3ecf60f220ddff14f4309133d0 Mon Sep 17 00:00:00 2001 From: Matt Mastracci Date: Sat, 1 Jul 2023 16:07:05 -0600 Subject: refactor(ops): op2 supports strings in argument and return position (#19613) Support strings (&str, String, and Cow) in the argument position and String in the return position. Avoids copies where possible, though this is not always something we can do. --- ops/op2/test_cases/sync/string_ref.rs | 4 ++++ 1 file changed, 4 insertions(+) create mode 100644 ops/op2/test_cases/sync/string_ref.rs (limited to 'ops/op2/test_cases/sync/string_ref.rs') diff --git a/ops/op2/test_cases/sync/string_ref.rs b/ops/op2/test_cases/sync/string_ref.rs new file mode 100644 index 000000000..a7efa9f0c --- /dev/null +++ b/ops/op2/test_cases/sync/string_ref.rs @@ -0,0 +1,4 @@ +// Copyright 2018-2023 the Deno authors. All rights reserved. MIT license. + +#[op2(fast)] +fn op_string_owned(#[string] s: &str) -> u32 {} -- cgit v1.2.3