From 1714c262c4e367030ef82e4295a40749dfcb19ef Mon Sep 17 00:00:00 2001 From: David Tolnay Date: Wed, 8 Mar 2023 19:15:28 -0800 Subject: [PATCH] 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. --- serde_derive/src/internals/attr.rs | 3 --- 1 file changed, 3 deletions(-) diff --git a/serde_derive/src/internals/attr.rs b/serde_derive/src/internals/attr.rs index 0b81bcc6..9fd3ef25 100644 --- a/serde_derive/src/internals/attr.rs +++ b/serde_derive/src/internals/attr.rs @@ -1626,9 +1626,6 @@ fn parse_lit_into_where( lit: &syn::Lit, ) -> Result, ()> { 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());