From 5980a218c32ff12f2645ddfdcf48acfe9af2aae0 Mon Sep 17 00:00:00 2001 From: bkushigian Date: Thu, 10 Oct 2024 15:33:05 -0400 Subject: [PATCH] Clippy: Result::or_else -> Result::map_err --- src/range.rs | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/src/range.rs b/src/range.rs index f65d9b7..febdb5a 100644 --- a/src/range.rs +++ b/src/range.rs @@ -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()) }) } }