From 25c6bc137ecfd1f608993a3d2f24c5736c5c186a Mon Sep 17 00:00:00 2001 From: Zach Reizner Date: Tue, 27 Feb 2018 22:22:35 -0800 Subject: sys_util: custom derive for PollToken Using an enum implementing PollToken is the recommended way to use PollContext, but writing the trait impls for each enum is mechanical yet error prone. This is a perfect candidate for a custom derive, which automates away the process using a simple derive attribute on an enum. BUG=chromium:816692 TEST=cargo test -p sys_util Change-Id: If21d0f94f9af4b4f6cef1f24c78fc36b50471053 Reviewed-on: https://chromium-review.googlesource.com/940865 Commit-Ready: Zach Reizner Tested-by: Zach Reizner Reviewed-by: Chirantan Ekbote --- sys_util/src/lib.rs | 4 ++++ 1 file changed, 4 insertions(+) (limited to 'sys_util/src/lib.rs') diff --git a/sys_util/src/lib.rs b/sys_util/src/lib.rs index 15c279d..e1a5026 100644 --- a/sys_util/src/lib.rs +++ b/sys_util/src/lib.rs @@ -7,6 +7,9 @@ extern crate data_model; extern crate libc; extern crate syscall_defines; +#[allow(unused_imports)] +#[macro_use] +extern crate poll_token_derive; #[macro_use] pub mod handle_eintr; @@ -47,6 +50,7 @@ pub use signalfd::*; pub use ioctl::*; pub use sock_ctrl_msg::*; pub use passwd::*; +pub use poll_token_derive::*; pub use mmap::Error as MmapError; pub use guest_memory::Error as GuestMemoryError; -- cgit 1.4.1