mirror of
https://github.com/serde-rs/serde.git
synced 2025-10-01 15:01:49 +00:00
Accept empty #[serde()] attribute
This commit is contained in:
parent
6ab55a1e52
commit
4cb8d079f8
@ -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")]
|
||||||
|
Loading…
x
Reference in New Issue
Block a user