1
0
Fork 0
mirror of https://github.com/denoland/deno.git synced 2024-12-11 18:17:48 -05:00
denoland-deno/ops/optimizer_tests/strings_result.rs
Divy Srivastava eda8c83d8b 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
2023-03-10 12:46:24 +09:00

4 lines
138 B
Rust

// https://github.com/denoland/deno/issues/16979
fn op_string_length(string: &str) -> Result<u32, AnyError> {
Ok(string.len() as u32)
}