tag | 7c11ddc11c044897bf115c45873f61ae48d81c11 | |
---|---|---|
tagger | The Android Open Source Project <initial-contribution@android.com> | Wed Apr 24 19:44:01 2024 -0700 |
object | c4a22a294a0e47d0feef06c67da4b9557123ae3d |
aml_per_341614000 (11428529,com.google.android.go.permission,com.google.android.permission)
commit | c4a22a294a0e47d0feef06c67da4b9557123ae3d | [log] [tgz] |
---|---|---|
author | Android Build Coastguard Worker <android-build-coastguard-worker@google.com> | Fri Jul 07 05:07:48 2023 +0000 |
committer | Android Build Coastguard Worker <android-build-coastguard-worker@google.com> | Fri Jul 07 05:07:48 2023 +0000 |
tree | 4d02240b6a356275f2e27bd9fea034214dd6efe0 | |
parent | f5793b6473ef722e82fc17ce6bccbf312aaba6af [diff] | |
parent | a419437bc9360dafcd1eb2a787647dc3184a14a7 [diff] |
Snap for 10453563 from a419437bc9360dafcd1eb2a787647dc3184a14a7 to mainline-permission-release Change-Id: Ic22d278df5eaa6daed49dd5bfb590b3ae4ea4d83
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.