summaryrefslogtreecommitdiffstats
path: root/src/version.rs
diff options
context:
space:
mode:
Diffstat (limited to 'src/version.rs')
-rw-r--r--src/version.rs16
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()])
}