mirror of
https://github.com/tauri-apps/plugins-workspace.git
synced 2026-09-26 21:41:48 +02:00
chore: fmt
This commit is contained in:
@@ -71,11 +71,12 @@ where
|
||||
{
|
||||
let opt = Option::<String>::deserialize(deserializer)?;
|
||||
if let Some(ref host) = opt
|
||||
&& let Some((scheme, _)) = host.split_once("://") {
|
||||
return Err(serde::de::Error::custom(format!(
|
||||
"host `{host}` cannot start with a scheme, please remove the `{scheme}://` prefix"
|
||||
)));
|
||||
}
|
||||
&& let Some((scheme, _)) = host.split_once("://")
|
||||
{
|
||||
return Err(serde::de::Error::custom(format!(
|
||||
"host `{host}` cannot start with a scheme, please remove the `{scheme}://` prefix"
|
||||
)));
|
||||
}
|
||||
Ok(opt)
|
||||
}
|
||||
|
||||
|
||||
@@ -65,10 +65,10 @@ fn init_deep_link<R: Runtime>(
|
||||
},
|
||||
)?;
|
||||
|
||||
return Ok(DeepLink {
|
||||
Ok(DeepLink {
|
||||
app: app.clone(),
|
||||
plugin_handle: handle,
|
||||
});
|
||||
})
|
||||
}
|
||||
|
||||
#[cfg(target_os = "ios")]
|
||||
@@ -417,9 +417,10 @@ mod imp {
|
||||
if mimeapps_path.exists() {
|
||||
let mut mimeapps = ini::Ini::load_from_file(&mimeapps_path)?;
|
||||
if let Some(section) = mimeapps.section_mut(Some("Default Applications"))
|
||||
&& section.get(&mime_type).unwrap_or_default() == file_name {
|
||||
section.remove(&mime_type);
|
||||
}
|
||||
&& section.get(&mime_type).unwrap_or_default() == file_name
|
||||
{
|
||||
section.remove(&mime_type);
|
||||
}
|
||||
mimeapps.write_to_file(&mimeapps_path)?;
|
||||
}
|
||||
|
||||
@@ -559,8 +560,6 @@ 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 {
|
||||
|
||||
|
||||
self.app.listen("deep-link://new-url", move |event| {
|
||||
if let Ok(urls) = serde_json::from_str(event.payload()) {
|
||||
f(OpenUrlEvent {
|
||||
|
||||
Reference in New Issue
Block a user