Switch to time crate, add file sizes (#329)

* Switch to time crate, add file sizes

* Update deps, adjust pack format

* Run formatter, fix clippy
This commit is contained in:
Geometrically
2022-03-29 19:35:09 -07:00
committed by GitHub
parent a3d5479878
commit 80e00a80d5
38 changed files with 563 additions and 318 deletions

View File

@@ -1,8 +1,8 @@
use crate::validate::{
SupportedGameVersions, ValidationError, ValidationResult,
};
use chrono::{DateTime, NaiveDateTime, Utc};
use std::io::Cursor;
use time::OffsetDateTime;
use zip::ZipArchive;
pub struct ForgeValidator;
@@ -22,9 +22,8 @@ impl super::Validator for ForgeValidator {
fn get_supported_game_versions(&self) -> SupportedGameVersions {
// Time since release of 1.13, the first forge version which uses the new TOML system
SupportedGameVersions::PastDate(DateTime::<Utc>::from_utc(
NaiveDateTime::from_timestamp(1540122067, 0),
Utc,
SupportedGameVersions::PastDate(OffsetDateTime::from_unix_timestamp(
1540122067,
))
}
@@ -68,14 +67,8 @@ impl super::Validator for LegacyForgeValidator {
fn get_supported_game_versions(&self) -> SupportedGameVersions {
// Times between versions 1.5.2 to 1.12.2, which all use the legacy way of defining mods
SupportedGameVersions::Range(
DateTime::from_utc(
NaiveDateTime::from_timestamp(1366818300, 0),
Utc,
),
DateTime::from_utc(
NaiveDateTime::from_timestamp(1505810340, 0),
Utc,
),
OffsetDateTime::from_unix_timestamp(1366818300),
OffsetDateTime::from_unix_timestamp(1505810340),
)
}