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