diff options
| author | 2025-01-31 02:32:19 -0600 | |
|---|---|---|
| committer | 2025-01-31 02:32:19 -0600 | |
| commit | cdeee17c2be5b8b9a333b977b3e2d373b94dfe0a (patch) | |
| tree | 58ec48b5bfa9afe03ebbd9716f1f90841af914e9 /src/version.rs | |
| parent | Remove some unused imports but not all of them (diff) | |
do clippy stuff and change line endings
Diffstat (limited to 'src/version.rs')
| -rw-r--r-- | src/version.rs | 16 |
1 files changed, 8 insertions, 8 deletions
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<E>(self, v: &str) -> Result<Self::Value, E> 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<DateTime<Utc>>; fn expecting(&self, formatter: &mut fmt::Formatter) -> fmt::Result { @@ -406,7 +406,7 @@ where fn visit_str<E>(self, v: &str) -> Result<Self::Value, E> where - E: de::Error, { + E: Error, { Ok(FromStr::from_str(v).unwrap()) } @@ -441,7 +441,7 @@ where fn visit_str<E>(self, v: &str) -> Result<Self::Value, E> where - E: de::Error, { + E: Error, { Ok(vec![FromStr::from_str(v).unwrap()]) } |
