Skip to content

Commit

Permalink
Fix more RangeFrom / RangeEnd mixups
Browse files Browse the repository at this point in the history
  • Loading branch information
dtolnay committed Nov 21, 2023
1 parent 24a78f0 commit 8c4af41
Showing 1 changed file with 5 additions and 5 deletions.
10 changes: 5 additions & 5 deletions serde/src/de/impls.rs
Original file line number Diff line number Diff line change
Expand Up @@ -2509,15 +2509,15 @@ where
where
D: Deserializer<'de>,
{
let end = tri!(deserializer.deserialize_struct(
let start = tri!(deserializer.deserialize_struct(
"RangeFrom",
range_from::FIELDS,
range_from::RangeFromVisitor {
expecting: "struct RangeFrom",
phantom: PhantomData,
},
));
Ok(end..)
Ok(start..)
}
}

Expand Down Expand Up @@ -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
Expand All @@ -2647,15 +2647,15 @@ where
where
D: Deserializer<'de>,
{
let start = tri!(deserializer.deserialize_struct(
let end = tri!(deserializer.deserialize_struct(
"RangeTo",
range_to::FIELDS,
range_to::RangeToVisitor {
expecting: "struct RangeTo",
phantom: PhantomData,
},
));
Ok(..start)
Ok(..end)
}
}

Expand Down

0 comments on commit 8c4af41

Please sign in to comment.