crosvm/sys_util/poll_token_derive
Chirantan Ekbote fec86cc3ae poll_token_derive: Calculate variant bits without sizeof_val
Calculate the number of bits necessary to represent the enum variant
using the next_power_of_two() and trailing_zeros() functions from the
primitive usize type.

Also add a test to ensure that the returned value is correct when there
is only one variant in the enum.

BUG=none
TEST=unit tests

Change-Id: Ibd15efd4f06e17a74489fee04ff19aca0dde68b2
Signed-off-by: Chirantan Ekbote <chirantan@chromium.org>
Reviewed-on: https://chromium-review.googlesource.com/959624
Reviewed-by: Zach Reizner <zachr@chromium.org>
2018-03-20 00:00:28 -07:00
..
Cargo.toml sys_util: custom derive for PollToken 2018-03-07 16:54:46 -08:00
poll_token_derive.rs poll_token_derive: Calculate variant bits without sizeof_val 2018-03-20 00:00:28 -07:00
tests.rs poll_token_derive: Calculate variant bits without sizeof_val 2018-03-20 00:00:28 -07:00