fixed clippy issues
This commit is contained in:
1 parent
db23b86dca
commit
3d7f233e27
2 files changed
+6
-9
No files matched your search
+2
-3
@@ -22,15 +22,14 @@ pub fn get_config_path() -> PathBuf {
|
|||||||
fn ensure_config_exists() -> PathBuf {
|
fn ensure_config_exists() -> PathBuf {
|
||||||
let config_path = get_config_path().join("config.toml");
|
let config_path = get_config_path().join("config.toml");
|
||||||
if !config_path.exists() {
|
if !config_path.exists() {
|
||||||
if let Some(parent) = config_path.parent() {
|
if let Some(parent) = config_path.parent()
|
||||||
if let Err(e) = fs::create_dir_all(parent) {
|
&& let Err(e) = fs::create_dir_all(parent) {
|
||||||
tracing::warn!(
|
tracing::warn!(
|
||||||
"Failed to create config directory {}: {}",
|
"Failed to create config directory {}: {}",
|
||||||
parent.display(),
|
parent.display(),
|
||||||
e
|
e
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
}
|
|
||||||
match fs::write(&config_path, include_str!("../../assets/config.toml")) {
|
match fs::write(&config_path, include_str!("../../assets/config.toml")) {
|
||||||
Ok(()) => tracing::debug!("Wrote default config to {}", config_path.display()),
|
Ok(()) => tracing::debug!("Wrote default config to {}", config_path.display()),
|
||||||
Err(e) => tracing::warn!(
|
Err(e) => tracing::warn!(
|
||||||
|
|||||||
@@ -144,15 +144,14 @@ async fn download_mod_files(
|
|||||||
.to_string();
|
.to_string();
|
||||||
let completed = completed.clone();
|
let completed = completed.clone();
|
||||||
tasks.spawn(async move {
|
tasks.spawn(async move {
|
||||||
if let Some(parent) = dest.parent() {
|
if let Some(parent) = dest.parent()
|
||||||
if let Err(e) = tokio::fs::create_dir_all(parent).await {
|
&& let Err(e) = tokio::fs::create_dir_all(parent).await {
|
||||||
tracing::warn!(
|
tracing::warn!(
|
||||||
"Failed to create mod download directory {}: {}",
|
"Failed to create mod download directory {}: {}",
|
||||||
parent.display(),
|
parent.display(),
|
||||||
e
|
e
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
}
|
|
||||||
progress::set_sub_action(filename);
|
progress::set_sub_action(filename);
|
||||||
tracing::trace!("Downloading .mrpack file to {}", dest.display());
|
tracing::trace!("Downloading .mrpack file to {}", dest.display());
|
||||||
crate::net::download_file(&client, &url, &dest, |_, _| {}).await?;
|
crate::net::download_file(&client, &url, &dest, |_, _| {}).await?;
|
||||||
@@ -183,15 +182,14 @@ async fn download_mod_files(
|
|||||||
.to_string();
|
.to_string();
|
||||||
let completed = completed.clone();
|
let completed = completed.clone();
|
||||||
tasks.spawn(async move {
|
tasks.spawn(async move {
|
||||||
if let Some(parent) = dest.parent() {
|
if let Some(parent) = dest.parent()
|
||||||
if let Err(e) = tokio::fs::create_dir_all(parent).await {
|
&& let Err(e) = tokio::fs::create_dir_all(parent).await {
|
||||||
tracing::warn!(
|
tracing::warn!(
|
||||||
"Failed to create mod download directory {}: {}",
|
"Failed to create mod download directory {}: {}",
|
||||||
parent.display(),
|
parent.display(),
|
||||||
e
|
e
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
}
|
|
||||||
progress::set_sub_action(filename);
|
progress::set_sub_action(filename);
|
||||||
tracing::trace!("Downloading .mrpack file to {}", dest.display());
|
tracing::trace!("Downloading .mrpack file to {}", dest.display());
|
||||||
crate::net::download_file(&client, &url, &dest, |_, _| {}).await?;
|
crate::net::download_file(&client, &url, &dest, |_, _| {}).await?;
|
||||||
|
|||||||
Reference in new issue
Block a user