mc-repack 0.1.0

A repacking tool for Minecraft mods to optimize size and loading speed of mods.
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
use std::{error::Error, fmt::Display};

const IGNORE_FILE_TYPES: &[&str] = &["blend", "blend1", "psd"];

pub fn can_ignore_type(s: &str) -> bool {
    IGNORE_FILE_TYPES.binary_search(&s).is_ok()
}

#[derive(Debug)]
pub struct BlacklistedFile;

impl Error for BlacklistedFile {}
impl Display for BlacklistedFile {
    fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
        write!(f, "WHY IS THIS FILE HERE?")
    }
}