Remove double nesting of first_attempt

`expr` is of type serde_derive::fragment::Expr, which can be
interpolated directly in any expression position. It does not
need to be nested in another set of braces.
This commit is contained in:
David Tolnay 2023-10-12 19:18:37 -07:00
parent 2a7c7faeb4
commit b908487476
No known key found for this signature in database
GPG Key ID: F9BA143B95FF6D82

View File

@ -1754,18 +1754,18 @@ fn deserialize_untagged_enum_after(
// need to provide the error type.
let first_attempt = first_attempt.map(|expr| {
quote! {
if let _serde::__private::Result::<_, __D::Error>::Ok(__ok) = (|| {
#expr
})() {
if let _serde::__private::Result::<_, __D::Error>::Ok(__ok) = (|| #expr)() {
return _serde::__private::Ok(__ok);
}
}
});
quote_block! {
let __content = <_serde::__private::de::Content as _serde::Deserialize>::deserialize(__deserializer)?;
let __deserializer = _serde::__private::de::ContentRefDeserializer::<__D::Error>::new(&__content);
#first_attempt
#(
if let _serde::__private::Ok(__ok) = #attempts {
return _serde::__private::Ok(__ok);