From 02f8e70a7138fcf99a40e052487240910f43b0f2 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E5=BE=90=E6=B6=9B?= Date: Tue, 21 Mar 2023 17:07:04 +0800 Subject: [PATCH] =?UTF-8?q?fix(list):=E5=B0=9D=E8=AF=95=E4=BF=AE=E5=A4=8D?= =?UTF-8?q?=E7=A3=81=E7=9B=98=E5=88=97=E8=A1=A8=E3=80=82?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src-tauri/src/commands/files.rs | 3 +++ 1 file changed, 3 insertions(+) diff --git a/src-tauri/src/commands/files.rs b/src-tauri/src/commands/files.rs index 7f65f12..019b11c 100644 --- a/src-tauri/src/commands/files.rs +++ b/src-tauri/src/commands/files.rs @@ -96,6 +96,7 @@ pub async fn show_drives( .iter() .filter(|m| !m.path.starts_with("/System") && !m.path.starts_with("/dev")); for mount in mounts { + #[cfg(any(target_os = "macos", target_os = "linux"))] let dirname = mount .path .as_path() @@ -104,6 +105,8 @@ pub async fn show_drives( .to_os_string() .into_string() .unwrap(); + #[cfg(target_os = "windows")] + let dirname = mount.name.clone().unwrap_or_default(); let dirname = if dirname.len() == 0 { String::from("/") } else {