From 38ab8b70c132150cd974a33d11bdf8048b99fb23 Mon Sep 17 00:00:00 2001 From: bigfoot547 Date: Thu, 16 Jan 2025 02:30:15 -0600 Subject: download client jar --- src/launcher/assets.rs | 8 ++------ 1 file changed, 2 insertions(+), 6 deletions(-) (limited to 'src/launcher/assets.rs') diff --git a/src/launcher/assets.rs b/src/launcher/assets.rs index 7d883d8..7ad368e 100644 --- a/src/launcher/assets.rs +++ b/src/launcher/assets.rs @@ -4,7 +4,7 @@ use std::fmt::{Display, Formatter}; use std::io::ErrorKind; use std::path::{Path, PathBuf}; use std::path::Component::Normal; -use futures::{stream, TryFutureExt, TryStreamExt}; +use futures::TryStreamExt; use log::{debug, info, warn}; use sha1_smol::Sha1; use tokio::{fs, io}; @@ -184,10 +184,6 @@ impl AssetRepository { format!("{}{:02x}/{}", super::constants::URL_RESOURCE_BASE, obj.hash.bytes()[0], obj.hash) } - async fn download_assets(&self, index: &AssetIndex) -> Result<(), AssetError> { - todo!() - } - async fn ensure_dir(path: impl AsRef) -> Result<(), io::Error> { match fs::create_dir(path).await { Ok(_) => Ok(()), @@ -198,7 +194,7 @@ impl AssetRepository { pub async fn ensure_assets(&self, index: &AssetIndex) -> Result<(), AssetError> { let mut downloads = Vec::new(); - let objects_path = [self.home.as_ref(), OsStr::new("objects")].iter().collect::(); + let objects_path = [self.home.as_ref(), OsStr::new(OBJECT_PATH)].iter().collect::(); Self::ensure_dir(&objects_path).await.map_err(|e| AssetError::IO { what: "creating objects directory", -- cgit v1.2.3-70-g09d2