mirror of
https://github.com/denoland/deno.git
synced 2024-12-24 08:09:08 -05:00
65d9bfb533
This is a new op system that will eventually replace `#[op]`. Features - More maintainable, generally less-coupled code - More modern Rust proc-macro libraries - Enforces correct `fast` labelling for fast ops, allowing for visual scanning of fast ops - Explicit marking of `#[string]`, `#[serde]` and `#[smi]` parameters. This first version of op2 supports integer and Option<integer> parameters only, and allows us to start working on converting ops and adding features.
6 lines
173 B
Rust
6 lines
173 B
Rust
// Copyright 2018-2023 the Deno authors. All rights reserved. MIT license.
|
|
|
|
#[op2(core)]
|
|
pub fn op_test_add_option(a: u32, b: Option<u32>) -> u32 {
|
|
a + b.unwrap_or(100)
|
|
}
|