napi-rs/crates
Ivan Enderlin cb2a407228 feat(napi) Implement ToNapiValue for 8 and 16-bits numbers.
`napi` only supports numbers in 16 and 32-bits. To support Rust
numbers with 8 and 16-bits, we can cast them to 32-bits. To convert
from 8 and 16-bits to 32-bits, we use their `Into` implementation. To
convert from 32-bits to 8 and 16-bits, we use their `TryInto`, we
should theorically not fail, but in case of, an `except` message is
appended.

The code has also been re-indented as it was containing a mix of 2
spaces, 4 spaces and tabs identation.
2022-05-25 14:43:23 +08:00
..
backend feat(napi-derive): add ts_arg_type attribute to override individual args on functions (#1192) 2022-05-22 13:43:11 +08:00
build Add rust-version field to Cargo.tomls (#1190) 2022-05-20 16:23:10 +08:00
macro feat(napi-derive): add ts_arg_type attribute to override individual args on functions (#1192) 2022-05-22 13:43:11 +08:00
napi feat(napi) Implement ToNapiValue for 8 and 16-bits numbers. 2022-05-25 14:43:23 +08:00
sys Add rust-version field to Cargo.tomls (#1190) 2022-05-20 16:23:10 +08:00