Fix more RangeFrom / RangeEnd mixups

This commit is contained in:
David Tolnay 2023-11-20 17:21:28 -08:00
parent 24a78f071b
commit 8c4af41296
No known key found for this signature in database
GPG Key ID: F9BA143B95FF6D82

View File

@ -2509,7 +2509,7 @@ where
where
D: Deserializer<'de>,
{
let end = tri!(deserializer.deserialize_struct(
let start = tri!(deserializer.deserialize_struct(
"RangeFrom",
range_from::FIELDS,
range_from::RangeFromVisitor {
@ -2517,7 +2517,7 @@ where
phantom: PhantomData,
},
));
Ok(end..)
Ok(start..)
}
}
@ -2637,7 +2637,7 @@ mod range_from {
// #[derive(Deserialize)]
// #[serde(deny_unknown_fields)]
// struct RangeTo<Idx> {
// start: Idx,
// end: Idx,
// }
impl<'de, Idx> Deserialize<'de> for RangeTo<Idx>
where
@ -2647,7 +2647,7 @@ where
where
D: Deserializer<'de>,
{
let start = tri!(deserializer.deserialize_struct(
let end = tri!(deserializer.deserialize_struct(
"RangeTo",
range_to::FIELDS,
range_to::RangeToVisitor {
@ -2655,7 +2655,7 @@ where
phantom: PhantomData,
},
));
Ok(..start)
Ok(..end)
}
}