commit | 94eb0f7329701efe1e0f4916671391dc509c074d | [log] [tgz] |
---|---|---|
author | James Farrell <[email protected]> | Thu May 09 20:27:08 2024 +0000 |
committer | Automerger Merge Worker <[email protected]> | Thu May 09 20:27:08 2024 +0000 |
tree | 380a17771ca4f5471074bf54204ca365cdb3a0a3 | |
parent | a9c9bd02db4af6b66c5f2a9376d852e68452b244 [diff] | |
parent | 1eb58b08673cc1a78c07b65f42d7856f0a33c772 [diff] |
Update Android.bp by running cargo_embargo am: 9ec41930e8 am: 1eb58b0867 Original change: https://android-review.googlesource.com/c/platform/external/rust/crates/num-derive/+/3080448 Change-Id: I934a4b35aabf66627868dc8c3921e885755085a3 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.