mark all enums as non-exhaustive

This commit is contained in:
Stefan Majewsky 2021-07-19 19:16:15 +02:00
parent c67bd06e3f
commit f39128a0a2
2 changed files with 7 additions and 0 deletions

View file

@ -390,6 +390,7 @@ fn process(e: Enum) -> String {
//enum declaration
lines.push(format!("/// {}", e.doc));
lines.push("#[derive(Clone, Copy, Debug, PartialEq, Eq, Hash)]".into());
lines.push("#[non_exhaustive]".into());
lines.push(format!("pub enum {} {{", e.name));
for v in e.variants.iter().filter(|v| v.enabled) {
if let Some(ref entities) = e.entities {