commit | f9aef9a5a5aec0645d2aed309502a8fb543fc6c8 | [log] [tgz] |
---|---|---|
author | Per Larsen <perlarsen@google.com> | Thu Apr 25 12:19:28 2024 +0000 |
committer | Per Larsen <perlarsen@google.com> | Fri Apr 26 10:14:56 2024 +0000 |
tree | 9e217ce249f44ec46bfafd0df7e949ecaa5e0162 | |
parent | 6acf04bb2e23da386651bf4b2491f46b74836fa3 [diff] |
Add Trusty makefile rules Test: build.py Bug: None Change-Id: Id97ce45264ee5f417f3d228d17418841e283c879
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.