From 497333e91bde18be48800a82e9d7ff3c78ded95c Mon Sep 17 00:00:00 2001 From: Graham Esau Date: Sun, 1 Sep 2024 11:30:54 +0100 Subject: [PATCH] Replace placeholder error message --- schemars_derive/src/schema_exprs.rs | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/schemars_derive/src/schema_exprs.rs b/schemars_derive/src/schema_exprs.rs index 976bbe04..3e1b4862 100644 --- a/schemars_derive/src/schema_exprs.rs +++ b/schemars_derive/src/schema_exprs.rs @@ -76,7 +76,12 @@ pub fn expr_for_repr(cont: &Container) -> Result { 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 {