use std::path::PathBuf; use std::sync::Arc; #[derive(Clone, Debug)] pub enum ZipSource { Local(&'static [u8]), File(PathBuf), } impl ZipSource { pub async fn load(self) -> Result, std::io::Error> { match self { ZipSource::Local(bytes) => Ok(Arc::from(bytes)), ZipSource::File(path) => { let bytes = tokio::fs::read(&path).await?; Ok(Arc::from(bytes.as_slice())) } } } }