mirror of
https://github.com/ElnuDev/rust-jmdict.git
synced 2025-05-12 01:45:52 -07:00
mark all enums as non-exhaustive
This commit is contained in:
parent
c67bd06e3f
commit
f39128a0a2
2 changed files with 7 additions and 0 deletions
|
@ -1,3 +1,9 @@
|
|||
# v3.0.0 (TBD)
|
||||
|
||||
Changes:
|
||||
|
||||
- All enums are now marked as non-exhaustive, since the JMdict tends to add more variants as time goes on.
|
||||
|
||||
# v2.0.0 (2021-07-19)
|
||||
|
||||
JMdict was updated to 2021-09-17. This requires the following changes in enum variants:
|
||||
|
|
|
@ -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 {
|
||||
|
|
Loading…
Add table
Reference in a new issue