diff --git a/daedalus/Cargo.toml b/daedalus/Cargo.toml index 6aff4dd..5c20d6a 100644 --- a/daedalus/Cargo.toml +++ b/daedalus/Cargo.toml @@ -1,6 +1,6 @@ [package] name = "daedalus" -version = "0.1.26" +version = "0.1.27" authors = ["Jai A "] edition = "2018" license = "MIT" diff --git a/daedalus/src/modded.rs b/daedalus/src/modded.rs index d678c1e..e72eafe 100644 --- a/daedalus/src/modded.rs +++ b/daedalus/src/modded.rs @@ -3,7 +3,7 @@ use crate::{download_file, Error}; use crate::minecraft::{ Argument, ArgumentType, Library, VersionInfo, VersionType, }; -use chrono::{DateTime, Utc}; +use chrono::{DateTime, TimeZone, Utc}; use serde::{Deserialize, Deserializer, Serialize}; use std::collections::HashMap; @@ -38,12 +38,8 @@ where { let s = String::deserialize(deserializer)?; - DateTime::parse_from_rfc3339(&s) - .map(|dt| dt.with_timezone(&Utc)) - .or_else(|_| { - DateTime::parse_from_str(&s, "%Y-%m-%dT%H:%M:%S%.f") - .map(|dt| dt.with_timezone(&Utc)) - }) + serde_json::from_str::>(&format!("\"{s}\"")) + .or_else(|_| Utc.datetime_from_str(&s, "%Y-%m-%dT%H:%M:%S%.9f")) .map_err(serde::de::Error::custom) } diff --git a/daedalus_client/Cargo.toml b/daedalus_client/Cargo.toml index 87b3d41..47f8aa9 100644 --- a/daedalus_client/Cargo.toml +++ b/daedalus_client/Cargo.toml @@ -1,6 +1,6 @@ [package] name = "daedalus_client" -version = "0.1.26" +version = "0.1.27" authors = ["Jai A "] edition = "2018"