Skip to content

Commit 0f7cbc8

Browse files
committed
fix(prost-derive): improve enum_type errors
1 parent d83a32b commit 0f7cbc8

1 file changed

Lines changed: 3 additions & 3 deletions

File tree

‎prost-derive/src/field/mod.rs‎

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -256,7 +256,7 @@ impl EnumType {
256256
_ => {}
257257
}
258258
}
259-
bail!("invalid value of enum_type attribute: {:?}", lit);
259+
bail!("invalid value of enum_type attribute: {}", quote!(#lit));
260260
}
261261
Meta::List(meta_list) => {
262262
let ident = meta_list.parse_args::<Ident>()?;
@@ -265,11 +265,11 @@ impl EnumType {
265265
} else if ident == "closed" {
266266
Ok(Some(EnumType::Closed))
267267
} else {
268-
bail!("invalid content of enum_type attribute: {:?}", ident);
268+
bail!("invalid content of enum_type attribute: {}", ident);
269269
}
270270
}
271271
_ => {
272-
bail!("invalid enum_type attribute: {:?}", attr);
272+
bail!("invalid enum_type attribute: {}", quote!(#attr));
273273
}
274274
}
275275
}

0 commit comments

Comments
 (0)