From cdeee17c2be5b8b9a333b977b3e2d373b94dfe0a Mon Sep 17 00:00:00 2001 From: bigfoot547 Date: Fri, 31 Jan 2025 02:32:19 -0600 Subject: do clippy stuff and change line endings --- src/version.rs | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) (limited to 'src/version.rs') diff --git a/src/version.rs b/src/version.rs index 2388390..6e9ad3f 100644 --- a/src/version.rs +++ b/src/version.rs @@ -43,7 +43,7 @@ impl Deref for WrappedRegex { } struct RegexVisitor; -impl<'de> Visitor<'de> for RegexVisitor { +impl Visitor<'_> for RegexVisitor { type Value = WrappedRegex; fn expecting(&self, formatter: &mut fmt::Formatter) -> fmt::Result { @@ -52,8 +52,8 @@ impl<'de> Visitor<'de> for RegexVisitor { fn visit_str(self, v: &str) -> Result where - E: de::Error, { - Regex::new(v).map_err(de::Error::custom).map(|r| WrappedRegex(r)) + E: Error, { + Regex::new(v).map_err(Error::custom).map(WrappedRegex) } } @@ -212,7 +212,7 @@ pub struct Library { impl Library { pub fn get_canonical_name(&self) -> String { - canonicalize_library_name(self.name.as_str(), self.natives.as_ref().map_or(None, |_| Some("__ozone_natives"))) + canonicalize_library_name(self.name.as_str(), self.natives.as_ref().map(|_| "__ozone_natives")) } } @@ -287,7 +287,7 @@ pub struct CompleteVersion { impl CompleteVersion { pub fn get_jar(&self) -> &String { - &self.jar.as_ref().unwrap_or(&self.id) + self.jar.as_ref().unwrap_or(&self.id) } pub fn apply_child(&mut self, other: &CompleteVersion) { @@ -358,7 +358,7 @@ where { struct DateTimeVisitor; - impl<'de> Visitor<'de> for DateTimeVisitor { + impl Visitor<'_> for DateTimeVisitor { type Value = Option>; fn expecting(&self, formatter: &mut fmt::Formatter) -> fmt::Result { @@ -406,7 +406,7 @@ where fn visit_str(self, v: &str) -> Result where - E: de::Error, { + E: Error, { Ok(FromStr::from_str(v).unwrap()) } @@ -441,7 +441,7 @@ where fn visit_str(self, v: &str) -> Result where - E: de::Error, { + E: Error, { Ok(vec![FromStr::from_str(v).unwrap()]) } -- cgit v1.2.3-70-g09d2