Skip to content

Commit

Permalink
Clippy: Result::or_else -> Result::map_err
Browse files Browse the repository at this point in the history
  • Loading branch information
bkushigian committed Oct 10, 2024
1 parent e260ef1 commit 5980a21
Showing 1 changed file with 2 additions and 4 deletions.
6 changes: 2 additions & 4 deletions src/range.rs
Original file line number Diff line number Diff line change
Expand Up @@ -981,10 +981,8 @@ impl<'de> Deserialize<'de> for Range {
where
E: de::Error,
{
Range::from_str(v).or_else(|m| {
Err(de::Error::custom(
format!("Invalid range string \"{}\"\n\n{}", v, m).as_str(),
))
Range::from_str(v).map_err(|m| {
de::Error::custom(format!("Invalid range string \"{}\"\n\n{}", v, m).as_str())
})
}
}
Expand Down

0 comments on commit 5980a21

Please sign in to comment.