tag | 4f1dd76b14f2849a03d7f25576a839cce9adc420 | |
---|---|---|
tagger | The Android Open Source Project <initial-contribution@android.com> | Wed May 08 00:18:06 2024 -0700 |
object | 727135ccdff286ed4d3d71b50b4b9ce7ee2d517d |
Android CTS 14.0 Release 4 (11801623)
commit | 727135ccdff286ed4d3d71b50b4b9ce7ee2d517d | [log] [tgz] |
---|---|---|
author | Android Build Coastguard Worker <android-build-coastguard-worker@google.com> | Fri Mar 10 02:21:07 2023 +0000 |
committer | Android Build Coastguard Worker <android-build-coastguard-worker@google.com> | Fri Mar 10 02:21:07 2023 +0000 |
tree | 4d02240b6a356275f2e27bd9fea034214dd6efe0 | |
parent | 83225e818a07bf4179afec4e0a96da52340bfcfd [diff] | |
parent | 99b88e44efed24f28565d9a487d5560050359095 [diff] |
Snap for 9719949 from 99b88e44efed24f28565d9a487d5560050359095 to udc-release Change-Id: I885f88934cc2916344e438cd4f47a716434cbb3c
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.