mirror of
https://github.com/kristoferssolo/filecaster.git
synced 2026-02-04 05:52:03 +00:00
refactor: add better messages
This commit is contained in:
@@ -60,12 +60,14 @@ fn extract_named_fields(input: &DeriveInput) -> Result<&FieldsNamed> {
|
||||
Fields::Named(fields) => Ok(fields),
|
||||
_ => Err(Error::new_spanned(
|
||||
&input.ident,
|
||||
"FromFile can only be derived for structs with named fields",
|
||||
r#"FromFile only works on structs with *named* fields.
|
||||
Tuple structs and unit structs are not supported."#,
|
||||
)),
|
||||
},
|
||||
_ => Err(Error::new_spanned(
|
||||
&input.ident,
|
||||
"FromFile can only be derived for structs",
|
||||
r#"FromFile only works on structs.
|
||||
Enums are not supported."#,
|
||||
)),
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user