commit | 429277df1924d80f148349de2eedc65af24f3aba | [log] [tgz] |
---|---|---|
author | James Farrell <[email protected]> | Wed May 22 23:09:23 2024 +0000 |
committer | Automerger Merge Worker <[email protected]> | Wed May 22 23:09:23 2024 +0000 |
tree | 65650c4914a01985b99ee66debf17a66908e958c | |
parent | 1eb58b08673cc1a78c07b65f42d7856f0a33c772 [diff] | |
parent | 19625938aff12d02fc842330bda2eb7898e86ff4 [diff] |
Update Android.bp by running cargo_embargo am: 19625938af Original change: https://android-review.googlesource.com/c/platform/external/rust/crates/num-derive/+/3096317 Change-Id: I5abef947c3424512b7d49fb81cb22983b85defeb 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.