Skip to content

Commit bc137a8

Browse files
committed
style: move imports to top of file
Address code review feedback: - Import fs and PathBuf at top instead of inline paths
1 parent feda77c commit bc137a8

1 file changed

Lines changed: 5 additions & 4 deletions

File tree

  • src-tauri/src/minecraft/launcher

src-tauri/src/minecraft/launcher/mod.rs

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,8 @@
1818
*/
1919

2020
use std::collections::HashSet;
21-
use std::path::Path;
21+
use std::fs;
22+
use std::path::{Path, PathBuf};
2223

2324
use std::process::exit;
2425

@@ -375,16 +376,16 @@ fn setup_vanilla_integration<D: Send + Sync>(
375376

376377
launcher_data.log(&format!("Linked vanilla {} folder", folder));
377378
} else if !enabled && target.is_symlink() {
378-
std::fs::remove_file(&target).ok();
379-
std::fs::create_dir_all(&target)?;
379+
fs::remove_file(&target).ok();
380+
fs::create_dir_all(&target)?;
380381
launcher_data.log(&format!("Unlinked vanilla {} folder", folder));
381382
}
382383
}
383384

384385
Ok(())
385386
}
386387

387-
fn get_vanilla_minecraft_dir() -> Option<std::path::PathBuf> {
388+
fn get_vanilla_minecraft_dir() -> Option<PathBuf> {
388389
#[cfg(target_os = "windows")]
389390
{
390391
dirs::data_dir().map(|p| p.join(".minecraft"))

0 commit comments

Comments
 (0)