chore: edition 2024

This commit is contained in:
Lucas Nogueira committed 2026-09-26 15:36:22 -03:00
1 parent b517cc7e85
commit 3d8a3c877b
100 files changed
+276 -253

No files matched your search

+13 -12
View File
@@ -11,8 +11,8 @@
//! calling those methods returns [`Error::UnsupportedPlatform`].
use tauri::{
plugin::{Builder, PluginApi, TauriPlugin},
AppHandle, EventId, Listener, Manager, Runtime,
plugin::{Builder, PluginApi, TauriPlugin},
};
mod commands;
@@ -33,8 +33,8 @@ fn init_deep_link<R: Runtime>(
let _api = api;
use tauri::{
ipc::{Channel, InvokeResponseBody},
Emitter,
ipc::{Channel, InvokeResponseBody},
};
let handle = _api.register_android_plugin(PLUGIN_IDENTIFIER, "DeepLinkPlugin")?;
@@ -94,7 +94,7 @@ fn init_deep_link<R: Runtime>(
#[cfg(target_os = "android")]
mod imp {
use tauri::{ipc::Channel, plugin::PluginHandle, AppHandle, Runtime};
use tauri::{AppHandle, Runtime, ipc::Channel, plugin::PluginHandle};
use serde::{Deserialize, Serialize};
@@ -172,7 +172,7 @@ mod imp {
use std::sync::Mutex;
#[cfg(target_os = "linux")]
use std::{
fs::{create_dir_all, File},
fs::{File, create_dir_all},
io::Write,
process::Command,
};
@@ -223,7 +223,9 @@ mod imp {
current.replace(vec![url.clone()]);
let _ = self.app.emit("deep-link://new-url", vec![url]);
} else if cfg!(debug_assertions) {
tracing::warn!("argument {url} does not match any configured deep link scheme; skipping it");
tracing::warn!(
"argument {url} does not match any configured deep link scheme; skipping it"
);
}
}
}
@@ -414,11 +416,10 @@ mod imp {
let mimeapps_path = self.app.path().config_dir()?.join("mimeapps.list");
if mimeapps_path.exists() {
let mut mimeapps = ini::Ini::load_from_file(&mimeapps_path)?;
if let Some(section) = mimeapps.section_mut(Some("Default Applications")) {
if section.get(&mime_type).unwrap_or_default() == file_name {
if let Some(section) = mimeapps.section_mut(Some("Default Applications"))
&& section.get(&mime_type).unwrap_or_default() == file_name {
section.remove(&mime_type);
}
}
mimeapps.write_to_file(&mimeapps_path)?;
}
@@ -558,16 +559,16 @@ impl<R: Runtime> DeepLink<R> {
///
/// Use `get_current` on app load to check whether your app was started via a deep link.
pub fn on_open_url<F: Fn(OpenUrlEvent) + Send + Sync + 'static>(&self, f: F) -> EventId {
let event_id = self.app.listen("deep-link://new-url", move |event| {
self.app.listen("deep-link://new-url", move |event| {
if let Ok(urls) = serde_json::from_str(event.payload()) {
f(OpenUrlEvent {
id: event.id(),
urls,
})
}
});
event_id
})
}
}