Eliminate special case on empty string passed to bound=""

This works just fine if we make syn parse "where " as a syn::WhereClause.

The serde(bound = "") attribute is definitely not common enough that it
would warrant a micro-optimization.
This commit is contained in:
David Tolnay 2023-03-08 19:15:28 -08:00
parent a42cdafdcd
commit 1714c262c4
No known key found for this signature in database
GPG Key ID: F9BA143B95FF6D82

View File

@ -1626,9 +1626,6 @@ fn parse_lit_into_where(
lit: &syn::Lit,
) -> Result<Vec<syn::WherePredicate>, ()> {
let string = get_lit_str2(cx, attr_name, meta_item_name, lit)?;
if string.value().is_empty() {
return Ok(Vec::new());
}
let where_string = syn::LitStr::new(&format!("where {}", string.value()), string.span());