Skip to content

Commit

Permalink
Merge pull request #2654 from dtolnay/rangestartend
Browse files Browse the repository at this point in the history
Fix more RangeFrom / RangeEnd mixups
  • Loading branch information
dtolnay authored Nov 21, 2023
2 parents 24a78f0 + 8c4af41 commit 332b0cb
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 332b0cb

Please sign in to comment.