Skip to content

Commit

Permalink
Replace placeholder error message
Browse files Browse the repository at this point in the history
  • Loading branch information
GREsau committed Sep 1, 2024
1 parent 5d58a4d commit 497333e
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion schemars_derive/src/schema_exprs.rs
Original file line number Diff line number Diff line change
Expand Up @@ -76,7 +76,12 @@ pub fn expr_for_repr(cont: &Container) -> Result<SchemaExpr, syn::Error> {

let variants = match &cont.data {
Data::Enum(variants) => variants,
_ => return Err(syn::Error::new(Span::call_site(), "oh no!")),
_ => {
return Err(syn::Error::new(
Span::call_site(),
"JsonSchema_repr can only be used on enums",
))
}
};

if let Some(non_unit_error) = variants.iter().find_map(|v| match v.style {
Expand Down

0 comments on commit 497333e

Please sign in to comment.