Fix clippy issues

This commit is contained in:
Jai A
2023-03-30 15:18:57 -07:00
parent 80e1ae4553
commit 4875ed4359
16 changed files with 114 additions and 87 deletions

View File

@@ -75,7 +75,7 @@ pub async fn download_client(
st: &State,
version_info: &GameVersionInfo,
) -> crate::Result<()> {
let ref version = version_info.id;
let version = &version_info.id;
log::debug!("Locating client for version {version}");
let client_download = version_info
.downloads
@@ -143,7 +143,7 @@ pub async fn download_assets(
stream::iter(index.objects.iter())
.map(Ok::<(&String, &Asset), crate::Error>)
.try_for_each_concurrent(None, |(name, asset)| async move {
let ref hash = asset.hash;
let hash = &asset.hash;
let resource_path = st.directories.object_dir(hash);
let url = format!(
"https://resources.download.minecraft.net/{sub_hash}/{hash}",
@@ -158,7 +158,7 @@ pub async fn download_assets(
let resource = fetch_cell
.get_or_try_init(|| fetch(&url, Some(hash), &permit))
.await?;
write(&resource_path, &resource, &permit).await?;
write(&resource_path, resource, &permit).await?;
log::info!("Fetched asset with hash {hash}");
}
Ok::<_, crate::Error>(())
@@ -172,7 +172,7 @@ pub async fn download_assets(
let resource_path = st.directories.legacy_assets_dir().join(
name.replace('/', &String::from(std::path::MAIN_SEPARATOR))
);
write(&resource_path, &resource, &permit).await?;
write(&resource_path, resource, &permit).await?;
log::info!("Fetched legacy asset with hash {hash}");
}
Ok::<_, crate::Error>(())