From 4654591d820403d6fa1a007fd55bb0d85947a6cc Mon Sep 17 00:00:00 2001 From: Lucas Fernandes Nogueira Date: Wed, 4 Sep 2024 08:18:42 -0300 Subject: [PATCH] fix(deep-link): allow empty config values (#1732) --- .changes/fix-deep-link-config.md | 5 +++++ plugins/deep-link/src/config.rs | 8 ++++++++ 2 files changed, 13 insertions(+) create mode 100644 .changes/fix-deep-link-config.md diff --git a/.changes/fix-deep-link-config.md b/.changes/fix-deep-link-config.md new file mode 100644 index 00000000..81b5bcf1 --- /dev/null +++ b/.changes/fix-deep-link-config.md @@ -0,0 +1,5 @@ +--- +"deep-link": patch +--- + +Allow empty configuration values. diff --git a/plugins/deep-link/src/config.rs b/plugins/deep-link/src/config.rs index 1796aa63..9cd2e66b 100644 --- a/plugins/deep-link/src/config.rs +++ b/plugins/deep-link/src/config.rs @@ -32,10 +32,12 @@ where #[derive(Deserialize)] pub struct Config { /// Mobile requires `https://` urls. + #[serde(default)] pub mobile: Vec, /// Desktop requires urls starting with `://`. /// These urls are also active in dev mode on Android. #[allow(unused)] // Used in tauri-bundler + #[serde(default)] pub desktop: DesktopProtocol, } @@ -46,3 +48,9 @@ pub enum DesktopProtocol { One(DeepLinkProtocol), List(Vec), } + +impl Default for DesktopProtocol { + fn default() -> Self { + Self::List(Vec::new()) + } +}