From 0f7cbc8bf73031617c9dc76a519ffc56cd928871 Mon Sep 17 00:00:00 2001 From: Mikhail Zabaluev Date: Sun, 17 Nov 2024 22:39:25 +0200 Subject: [PATCH] fix(prost-derive): improve enum_type errors --- prost-derive/src/field/mod.rs | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/prost-derive/src/field/mod.rs b/prost-derive/src/field/mod.rs index 033ebe8a8..5716422af 100644 --- a/prost-derive/src/field/mod.rs +++ b/prost-derive/src/field/mod.rs @@ -256,7 +256,7 @@ impl EnumType { _ => {} } } - bail!("invalid value of enum_type attribute: {:?}", lit); + bail!("invalid value of enum_type attribute: {}", quote!(#lit)); } Meta::List(meta_list) => { let ident = meta_list.parse_args::()?; @@ -265,11 +265,11 @@ impl EnumType { } else if ident == "closed" { Ok(Some(EnumType::Closed)) } else { - bail!("invalid content of enum_type attribute: {:?}", ident); + bail!("invalid content of enum_type attribute: {}", ident); } } _ => { - bail!("invalid enum_type attribute: {:?}", attr); + bail!("invalid enum_type attribute: {}", quote!(#attr)); } } }