Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 6 additions & 0 deletions .changes/autostart-remove-static-constraint.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
---
autostart: minor:enhance
autostart-js: minor:enhance
---

Use the generic `IntoIterator<Item = impl Into<String>>` instead of `Vec<&'static str>` as the parameter type for `init(args)` to remove the `&'static` lifetime constraint.
11 changes: 8 additions & 3 deletions plugins/autostart/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -234,10 +234,15 @@ impl Builder {
/// Initializes the plugin.
///
/// `args` - are passed to your app on startup.
pub fn init<R: Runtime>(
// TODO: Remove `init` function or `args` argument in v3
pub fn init<R: Runtime, I, S>(
#[allow(unused)] macos_launcher: MacosLauncher,
args: Option<Vec<&'static str>>,
) -> TauriPlugin<R> {
args: Option<I>,
) -> TauriPlugin<R>
where
I: IntoIterator<Item = S>,
S: Into<String>,
{
let mut builder = Builder::new();
if let Some(args) = args {
builder = builder.args(args)
Expand Down
Loading