Run fmt, fix dep route (#312)

This commit is contained in:
Geometrically
2022-02-27 21:44:00 -07:00
committed by GitHub
parent 725f8571bb
commit 459e36c027
53 changed files with 1798 additions and 867 deletions

View File

@@ -1,4 +1,6 @@
use crate::validate::{SupportedGameVersions, ValidationError, ValidationResult};
use crate::validate::{
SupportedGameVersions, ValidationError, ValidationResult,
};
use chrono::{DateTime, NaiveDateTime, Utc};
use std::io::Cursor;
use zip::ZipArchive;
@@ -31,13 +33,14 @@ impl super::Validator for FabricValidator {
archive: &mut ZipArchive<Cursor<bytes::Bytes>>,
) -> Result<ValidationResult, ValidationError> {
archive.by_name("fabric.mod.json").map_err(|_| {
ValidationError::InvalidInputError("No fabric.mod.json present for Fabric file.".into())
ValidationError::InvalidInputError(
"No fabric.mod.json present for Fabric file.".into(),
)
})?;
if !archive
.file_names()
.any(|name| name.ends_with("refmap.json") || name.ends_with(".class"))
{
if !archive.file_names().any(|name| {
name.ends_with("refmap.json") || name.ends_with(".class")
}) {
return Ok(ValidationResult::Warning(
"Fabric mod file is a source file!",
));