diff --git a/.changes/autostart-remove-static-constraint.md b/.changes/autostart-remove-static-constraint.md new file mode 100644 index 0000000000..6652e19e43 --- /dev/null +++ b/.changes/autostart-remove-static-constraint.md @@ -0,0 +1,6 @@ +--- +autostart: minor:enhance +autostart-js: minor:enhance +--- + +Use the generic `IntoIterator>` instead of `Vec<&'static str>` as the parameter type for `init(args)` to remove the `&'static` lifetime constraint. diff --git a/plugins/autostart/src/lib.rs b/plugins/autostart/src/lib.rs index 4b4c7c23a9..38d1834830 100644 --- a/plugins/autostart/src/lib.rs +++ b/plugins/autostart/src/lib.rs @@ -234,10 +234,15 @@ impl Builder { /// Initializes the plugin. /// /// `args` - are passed to your app on startup. -pub fn init( +// TODO: Remove `init` function or `args` argument in v3 +pub fn init( #[allow(unused)] macos_launcher: MacosLauncher, - args: Option>, -) -> TauriPlugin { + args: Option, +) -> TauriPlugin +where + I: IntoIterator, + S: Into, +{ let mut builder = Builder::new(); if let Some(args) = args { builder = builder.args(args)