| commit | 4feeeacb57d7a0fb3f451bddd518be9fed211a6b | [log] [tgz] |
|---|---|---|
| author | Chih-Hung Hsieh <chh@google.com> | Wed Sep 30 19:55:11 2020 -0700 |
| committer | Chih-Hung Hsieh <chh@google.com> | Wed Sep 30 20:02:05 2020 -0700 |
| tree | fe685f62dad88790e374a48934534d4517add021 | |
| parent | 84f183eccb9a3b3bf3c49aa8596f03f5146f734c [diff] |
Fix version number error. * Older version number used in one CL after an update in another CL. * Use the updater.sh update --refresh --keep_date command to check and fix local changes. * Also refresh Android.bp. Test: tools/external_updater/updater.sh update --refresh --keep_date rust/crates/num-derive Change-Id: Ieaa081503b7b8e15fa92ae279a672df1f9c2a955
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.