chore(network): delete dead pub mod commands block in network/mod.rs
The inner `pub mod commands` block in network/mod.rs hosted three
unregistered Tauri commands (get_network_mounts_cmd,
check_mount_accessible, check_network_paths_batch) and was uncalled.
The non-command helpers in the parent module (get_network_mounts,
check_mount_accessibility, find_mount_for_path, parse_mount_info)
are also no longer referenced now that the commands are gone, but
they remain pub for potential future use without warnings.
- Remove the inner `pub mod commands { ... }` block.
- Drop the now-unused std::collections::HashMap import.
cc
This commit is contained in:
1 file changed
-46
@@ -9,7 +9,6 @@
|
|||||||
//! - Offline mode (accessibility of network content)
|
//! - Offline mode (accessibility of network content)
|
||||||
|
|
||||||
use serde::{Deserialize, Serialize};
|
use serde::{Deserialize, Serialize};
|
||||||
use std::collections::HashMap;
|
|
||||||
use std::fs;
|
use std::fs;
|
||||||
use std::path::Path;
|
use std::path::Path;
|
||||||
|
|
||||||
@@ -370,51 +369,6 @@ pub fn get_all_mounts() -> Vec<MountInfo> {
|
|||||||
parse_mount_info().unwrap_or_default()
|
parse_mount_info().unwrap_or_default()
|
||||||
}
|
}
|
||||||
|
|
||||||
// Tauri commands
|
|
||||||
pub mod commands {
|
|
||||||
use super::*;
|
|
||||||
|
|
||||||
/// Get all network mounts currently visible
|
|
||||||
#[tauri::command]
|
|
||||||
pub fn get_network_mounts_cmd() -> Vec<MountInfo> {
|
|
||||||
get_network_mounts()
|
|
||||||
}
|
|
||||||
|
|
||||||
/// Check if a network mount is currently accessible
|
|
||||||
#[tauri::command]
|
|
||||||
pub fn check_mount_accessible(mount_point: String) -> bool {
|
|
||||||
check_mount_accessibility(&mount_point)
|
|
||||||
}
|
|
||||||
|
|
||||||
/// Batch check multiple paths for network status
|
|
||||||
#[tauri::command]
|
|
||||||
pub fn check_network_paths_batch(paths: Vec<String>) -> HashMap<String, NetworkPathInfo> {
|
|
||||||
let mounts = parse_mount_info().unwrap_or_default();
|
|
||||||
|
|
||||||
paths
|
|
||||||
.into_iter()
|
|
||||||
.map(|p| {
|
|
||||||
let path = Path::new(&p);
|
|
||||||
let info = if let Some(mount) = find_mount_for_path(path, &mounts) {
|
|
||||||
let is_network = matches!(mount.kind, MountKind::Network(_));
|
|
||||||
NetworkPathInfo {
|
|
||||||
is_network,
|
|
||||||
mount_info: Some(mount),
|
|
||||||
path: p.clone(),
|
|
||||||
}
|
|
||||||
} else {
|
|
||||||
NetworkPathInfo {
|
|
||||||
is_network: false,
|
|
||||||
mount_info: None,
|
|
||||||
path: p.clone(),
|
|
||||||
}
|
|
||||||
};
|
|
||||||
(p, info)
|
|
||||||
})
|
|
||||||
.collect()
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
#[cfg(not(target_os = "linux"))]
|
#[cfg(not(target_os = "linux"))]
|
||||||
fn parse_mount_info() -> Result<Vec<MountInfo>, String> {
|
fn parse_mount_info() -> Result<Vec<MountInfo>, String> {
|
||||||
Ok(Vec::new())
|
Ok(Vec::new())
|
||||||
|
|||||||
Reference in new issue
Block a user