Skip to content

Commit 593d719

Browse files
committed
Rename macOS -> MS in disk detection code
1 parent 616c4ab commit 593d719

1 file changed

Lines changed: 23 additions & 23 deletions

File tree

src-tauri/src/commands/disk.rs

Lines changed: 23 additions & 23 deletions
Original file line numberDiff line numberDiff line change
@@ -38,20 +38,20 @@ pub async fn list_disks(use_sudo: bool) -> Result<DiskListResult, String> {
3838
tokio::task::spawn_blocking(move || {
3939
// Run both list commands and merge results:
4040
// - `list` (native): correctly detects Linux filesystems on Linux-only cards
41-
// - `list -m` (macOS fallback): works with broken GUID tables
41+
// - `list -m` (Microsoft fallback): works with broken GUID tables
4242

4343
// First, try native detection (without -m)
4444
let native_result = execute_command(&["list"], use_sudo, None)
4545
.ok()
4646
.and_then(|output| parse_disk_list_output(&output).ok());
4747

48-
// Then get macOS fallback (with -m)
49-
let macos_result = execute_command(&["list", "-m"], use_sudo, None)
48+
// Then get MS fallback (with -m)
49+
let ms_result = execute_command(&["list", "-m"], use_sudo, None)
5050
.ok()
5151
.and_then(|output| parse_disk_list_output(&output).ok());
5252

53-
// Merge results: prefer native detection, add macOS-only disks
54-
let mut result = merge_disk_results(native_result, macos_result);
53+
// Merge results: prefer native detection, add MS-only disks
54+
let mut result = merge_disk_results(native_result, ms_result);
5555

5656
// Check which partitions are already mounted by the system
5757
update_mount_status(&mut result);
@@ -73,7 +73,7 @@ pub async fn list_disks(use_sudo: bool) -> Result<DiskListResult, String> {
7373

7474
fn merge_disk_results(
7575
native: Option<DiskListResult>,
76-
macos: Option<DiskListResult>,
76+
ms: Option<DiskListResult>,
7777
) -> DiskListResult {
7878
use std::collections::HashMap;
7979

@@ -86,16 +86,16 @@ fn merge_disk_results(
8686
}
8787
}
8888

89-
// Then, add disks from macOS fallback that weren't in native
89+
// Then, add disks from MS fallback that weren't in native
9090
// For disks that exist in both, merge partitions preferring native filesystem detection
91-
if let Some(macos_result) = macos {
92-
for macos_disk in macos_result.disks {
93-
if let Some(native_disk) = disk_map.get_mut(&macos_disk.device) {
91+
if let Some(ms_result) = ms {
92+
for ms_disk in ms_result.disks {
93+
if let Some(native_disk) = disk_map.get_mut(&ms_disk.device) {
9494
// Disk exists in both - merge partitions
95-
merge_partitions(native_disk, macos_disk);
95+
merge_partitions(native_disk, ms_disk);
9696
} else {
97-
// Disk only in macOS result - add it
98-
disk_map.insert(macos_disk.device.clone(), macos_disk);
97+
// Disk only in MS result - add it
98+
disk_map.insert(ms_disk.device.clone(), ms_disk);
9999
}
100100
}
101101
}
@@ -111,7 +111,7 @@ fn merge_disk_results(
111111
}
112112
}
113113

114-
fn merge_partitions(native_disk: &mut Disk, macos_disk: Disk) {
114+
fn merge_partitions(native_disk: &mut Disk, ms_disk: Disk) {
115115
use std::collections::HashMap;
116116

117117
// Build map of native partitions by device
@@ -120,21 +120,21 @@ fn merge_partitions(native_disk: &mut Disk, macos_disk: Disk) {
120120
partition_map.insert(partition.device.clone(), partition);
121121
}
122122

123-
// Merge with macOS partitions
124-
for macos_partition in macos_disk.partitions {
125-
if let Some(native_partition) = partition_map.get_mut(&macos_partition.device) {
123+
// Merge with MS partitions
124+
for ms_partition in ms_disk.partitions {
125+
if let Some(native_partition) = partition_map.get_mut(&ms_partition.device) {
126126
// Partition exists in both - prefer native filesystem if it's a known Linux type
127-
// Otherwise use macOS detection
127+
// Otherwise use MS detection
128128
if !is_linux_native_fs(&native_partition.filesystem)
129129
&& native_partition.filesystem == "Microsoft Basic Data"
130130
{
131-
// Native showed generic type, use macOS detection
132-
native_partition.filesystem = macos_partition.filesystem;
133-
native_partition.label = macos_partition.label;
131+
// Native showed generic type, use MS detection
132+
native_partition.filesystem = ms_partition.filesystem;
133+
native_partition.label = ms_partition.label;
134134
}
135135
} else {
136-
// Partition only in macOS result - add it
137-
partition_map.insert(macos_partition.device.clone(), macos_partition);
136+
// Partition only in MS result - add it
137+
partition_map.insert(ms_partition.device.clone(), ms_partition);
138138
}
139139
}
140140

0 commit comments

Comments
 (0)