mirror of
https://github.com/clap-rs/clap
synced 2024-11-10 06:44:16 +00:00
fix: Amend error message when deriving enums
Clarify that only unit variants are fully supported, and that non-unit variants must be skipped.
This commit is contained in:
parent
6079a871a0
commit
42cb87b4b6
2 changed files with 2 additions and 2 deletions
|
@ -84,7 +84,7 @@ fn lits(
|
|||
None
|
||||
} else {
|
||||
if !matches!(variant.fields, Fields::Unit) {
|
||||
abort!(variant.span(), "`#[derive(ValueEnum)]` only supports non-unit variants, unless they are skipped");
|
||||
abort!(variant.span(), "`#[derive(ValueEnum)]` only supports unit variants. Non-unit variants must be skipped");
|
||||
}
|
||||
let fields = attrs.field_methods(false);
|
||||
let name = attrs.cased_name();
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
error: `#[derive(ValueEnum)]` only supports non-unit variants, unless they are skipped
|
||||
error: `#[derive(ValueEnum)]` only supports unit variants. Non-unit variants must be skipped
|
||||
--> tests/derive_ui/value_enum_non_unit.rs:5:5
|
||||
|
|
||||
5 | Foo(usize),
|
||||
|
|
Loading…
Reference in a new issue