commit | 2b706fe77baadaa626c0da3ad66b69a9eff41d02 | [log] [tgz] |
---|---|---|
author | Treehugger Robot <[email protected]> | Wed Jun 15 22:28:13 2022 +0000 |
committer | Automerger Merge Worker <[email protected]> | Wed Jun 15 22:28:13 2022 +0000 |
tree | 75f57a29ac6cac238a6e6aebb0f09f5d5c68f1a6 | |
parent | 848a97f79110bf536b9d0cff33b53fa8400e2274 [diff] | |
parent | ca64e21d337c00b4e3d51ef89ffc5e422c56cf2d [diff] |
Merge "Update TEST_MAPPING" am: 727035ffcc am: d777098818 am: a7e838343b am: ca64e21d33 Original change: https://android-review.googlesource.com/c/platform/external/rust/crates/num-derive/+/2125751 Change-Id: Ie9b85ddffc6bcd85686690cbb61d5c490111afaa Signed-off-by: Automerger Merge Worker <[email protected]>
Procedural macros to derive numeric traits in Rust.
Add this to your Cargo.toml
:
[dependencies] num-traits = "0.2" num-derive = "0.3"
and this to your crate root:
#[macro_use] extern crate num_derive;
Then you can derive traits on your own types:
#[derive(FromPrimitive, ToPrimitive)] enum Color { Red, Blue, Green, }
full-syntax
— Enables num-derive
to handle enum discriminants represented by complex expressions. Usually can be avoided by utilizing constants, so only use this feature if namespace pollution is undesired and compile time doubling is acceptable.Release notes are available in RELEASES.md.
The num-derive
crate is tested for rustc 1.31 and greater.
Licensed under either of
at your option.
Unless you explicitly state otherwise, any contribution intentionally submitted for inclusion in the work by you, as defined in the Apache-2.0 license, shall be dual licensed as above, without any additional terms or conditions.