mirror of
https://chromium.googlesource.com/crosvm/crosvm
synced 2025-02-11 04:26:38 +00:00
msg_socket: allow Enum with no variant filed types
This is to allow the Enum which doesn't have filed type for all its variants to derive the MsgOnSocket. BUG=None TEST=cargo test -p msg_socket Change-Id: Iab9edda777f42e25af40e4ec0e5870401c17572b Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/crosvm/+/2143572 Reviewed-by: Zach Reizner <zachr@chromium.org> Tested-by: kokoro <noreply+kokoro@google.com> Commit-Queue: Chuanxiao Dong <chuanxiao.dong@intel.corp-partner.google.com>
This commit is contained in:
parent
220eaf5d2d
commit
1d6af551b9
1 changed files with 5 additions and 0 deletions
|
@ -190,6 +190,11 @@ fn define_uses_fd_for_enum(de: &DataEnum) -> TokenStream {
|
|||
variant_field_types.push(variant_field_ty);
|
||||
}
|
||||
}
|
||||
|
||||
if variant_field_types.len() == 0 {
|
||||
return quote!();
|
||||
}
|
||||
|
||||
quote! {
|
||||
fn uses_fd() -> bool {
|
||||
#(<#variant_field_types>::uses_fd())||*
|
||||
|
|
Loading…
Reference in a new issue