mirror of
https://github.com/pezkuwichain/serde.git
synced 2026-06-12 22:31:02 +00:00
Accept empty #[serde()] attribute
This commit is contained in:
@@ -307,6 +307,12 @@ impl Container {
|
|||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if let syn::Meta::List(meta) = &attr.meta {
|
||||||
|
if meta.tokens.is_empty() {
|
||||||
|
continue;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
if let Err(err) = attr.parse_nested_meta(|meta| {
|
if let Err(err) = attr.parse_nested_meta(|meta| {
|
||||||
if meta.path == RENAME {
|
if meta.path == RENAME {
|
||||||
// #[serde(rename = "foo")]
|
// #[serde(rename = "foo")]
|
||||||
@@ -762,6 +768,12 @@ impl Variant {
|
|||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if let syn::Meta::List(meta) = &attr.meta {
|
||||||
|
if meta.tokens.is_empty() {
|
||||||
|
continue;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
if let Err(err) = attr.parse_nested_meta(|meta| {
|
if let Err(err) = attr.parse_nested_meta(|meta| {
|
||||||
if meta.path == RENAME {
|
if meta.path == RENAME {
|
||||||
// #[serde(rename = "foo")]
|
// #[serde(rename = "foo")]
|
||||||
@@ -1033,6 +1045,12 @@ impl Field {
|
|||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if let syn::Meta::List(meta) = &attr.meta {
|
||||||
|
if meta.tokens.is_empty() {
|
||||||
|
continue;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
if let Err(err) = attr.parse_nested_meta(|meta| {
|
if let Err(err) = attr.parse_nested_meta(|meta| {
|
||||||
if meta.path == RENAME {
|
if meta.path == RENAME {
|
||||||
// #[serde(rename = "foo")]
|
// #[serde(rename = "foo")]
|
||||||
|
|||||||
Reference in New Issue
Block a user