mirror of
https://github.com/tauri-apps/plugins-workspace.git
synced 2026-09-22 21:30:44 +02:00
fix(shell): fix schema requiring sidecar property even though it is optional (#1839)
* fix(shell): fix schema requiring `sidecar` property even though it is optional * fix clippy * make `cmd` and `sidecar` exclusive * make args optional * cleanup --------- Co-authored-by: Lucas Nogueira <lucas@tauri.app>
This commit is contained in:
co-authored by
Lucas Nogueira
parent
2f7e32b5e0
commit
44273b9889
+10
-17
@@ -47,23 +47,16 @@ enum HttpScopeEntry {
|
||||
},
|
||||
}
|
||||
|
||||
// Ensure scope entry is kept up to date
|
||||
impl From<HttpScopeEntry> for scope::Entry {
|
||||
fn from(value: HttpScopeEntry) -> Self {
|
||||
let url = match value {
|
||||
HttpScopeEntry::Value(url) => url,
|
||||
HttpScopeEntry::Object { url } => url,
|
||||
};
|
||||
|
||||
scope::Entry {
|
||||
url: urlpattern::UrlPattern::parse(
|
||||
urlpattern::UrlPatternInit::parse_constructor_string::<regex::Regex>(&url, None)
|
||||
.unwrap(),
|
||||
Default::default(),
|
||||
)
|
||||
.unwrap(),
|
||||
}
|
||||
}
|
||||
// Ensure `HttpScopeEntry` and `scope::EntryRaw` is kept in sync
|
||||
fn _f() {
|
||||
match scope::EntryRaw::Value(String::new()) {
|
||||
scope::EntryRaw::Value(url) => HttpScopeEntry::Value(url),
|
||||
scope::EntryRaw::Object { url } => HttpScopeEntry::Object { url },
|
||||
};
|
||||
match HttpScopeEntry::Value(String::new()) {
|
||||
HttpScopeEntry::Value(url) => scope::EntryRaw::Value(url),
|
||||
HttpScopeEntry::Object { url } => scope::EntryRaw::Object { url },
|
||||
};
|
||||
}
|
||||
|
||||
fn main() {
|
||||
|
||||
Reference in New Issue
Block a user