refactor(utils): extract freedesktop mimeapps handling into utils/mime

This commit is contained in:
Slinetrac
2025-12-25 10:02:07 +08:00
parent 4ffb8b415f
commit bd62a4ecc0
3 changed files with 10 additions and 2 deletions

View File

@@ -493,7 +493,7 @@ pub fn init_scheme() -> Result<()> {
}
}
crate::utils::linux::ensure_mimeapps_entries(DESKTOP_FILE, DEEP_LINK_SCHEMES)?;
crate::utils::mime::ensure_mimeapps_entries(DESKTOP_FILE, DEEP_LINK_SCHEMES)?;
Ok(())
}
#[cfg(target_os = "macos")]

View File

@@ -1,3 +1,11 @@
//! Utilities for working with freedesktop MIME / mimeapps.list.
//!
//! NOTE:
//! `mimeapps.list` is not a strict INI file.
//! We intentionally perform line-based, round-trip edits instead of using
//! an INI parser to preserve comments, ordering, duplicate keys and desktop
//! environment quirks.
use anyhow::Result;
use std::collections::HashMap;
use std::env;

View File

@@ -5,7 +5,7 @@ pub mod help;
pub mod i18n;
pub mod init;
#[cfg(target_os = "linux")]
pub mod linux;
pub mod mime;
pub mod network;
pub mod notification;
pub mod resolve;