Debian Codegraph @

third_party/rust/uniffi_bindgen/src/pipeline/general/enums.rs

raw
1 /* This Source Code Form is subject to the terms of the Mozilla Public
2 * License, v. 2.0. If a copy of the MPL was not distributed with this
3 * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
4
5 use super::*;
6
7 pub fn pass(en: &mut Enum) -> Result<()> {
8 en.is_flat = match en.shape {
9 EnumShape::Error { flat } => flat,
10 EnumShape::Enum => en.variants.iter().all(|v| v.fields.is_empty()),
11 };
12 Ok(())
13 }