mirror of
https://github.com/clash-verge-rev/clash-verge-rev.git
synced 2026-01-29 00:35:38 +08:00
fix: resolve clippy lint in linux utils
This commit is contained in:
@@ -536,7 +536,7 @@ pub fn ensure_mimeapps_entries(desktop_file: &str, schemes: &[&str]) -> Result<(
|
|||||||
|
|
||||||
if !default_present {
|
if !default_present {
|
||||||
changed = true;
|
changed = true;
|
||||||
if !output_lines.is_empty() && !output_lines.last().unwrap().is_empty() {
|
if output_lines.last().is_some_and(|line| !line.is_empty()) {
|
||||||
output_lines.push(String::new());
|
output_lines.push(String::new());
|
||||||
}
|
}
|
||||||
output_lines.push("[Default Applications]".to_string());
|
output_lines.push("[Default Applications]".to_string());
|
||||||
@@ -572,10 +572,8 @@ fn mimeapps_list_path() -> Option<PathBuf> {
|
|||||||
dir
|
dir
|
||||||
});
|
});
|
||||||
|
|
||||||
if let Some(ref path) = config_path {
|
if config_path.as_ref().is_some_and(|path| path.exists()) {
|
||||||
if path.exists() {
|
return config_path;
|
||||||
return Some(path.clone());
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
let data_path = env::var_os("XDG_DATA_HOME")
|
let data_path = env::var_os("XDG_DATA_HOME")
|
||||||
@@ -593,10 +591,8 @@ fn mimeapps_list_path() -> Option<PathBuf> {
|
|||||||
dir
|
dir
|
||||||
});
|
});
|
||||||
|
|
||||||
if let Some(ref path) = data_path {
|
if data_path.as_ref().is_some_and(|path| path.exists()) {
|
||||||
if path.exists() {
|
return data_path;
|
||||||
return Some(path.clone());
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
config_path
|
config_path
|
||||||
|
|||||||
Reference in New Issue
Block a user