You've already forked AstralRinth
forked from didirus/AstralRinth
Run fmt, fix dep route (#312)
This commit is contained in:
@@ -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!",
|
||||
));
|
||||
|
||||
Reference in New Issue
Block a user