diff --git a/.changes/remove-plugin-static-constraint.md b/.changes/remove-plugin-static-constraint.md new file mode 100644 index 000000000000..b509395377e6 --- /dev/null +++ b/.changes/remove-plugin-static-constraint.md @@ -0,0 +1,5 @@ +--- +tauri: minor:enhance +--- + +Changed the parameter type of `AppHandle::remove_plugin` from `&'static str` to `&str`. diff --git a/crates/tauri/src/app.rs b/crates/tauri/src/app.rs index 08abce267943..16c1b0d981a8 100644 --- a/crates/tauri/src/app.rs +++ b/crates/tauri/src/app.rs @@ -526,7 +526,7 @@ impl AppHandle { /// Ok(()) /// }); /// ``` - pub fn remove_plugin(&self, plugin: &'static str) -> bool { + pub fn remove_plugin(&self, plugin: &str) -> bool { self.manager().plugins.lock().unwrap().unregister(plugin) } diff --git a/crates/tauri/src/plugin.rs b/crates/tauri/src/plugin.rs index e7a346a5c6e4..e1624377c3f3 100644 --- a/crates/tauri/src/plugin.rs +++ b/crates/tauri/src/plugin.rs @@ -886,7 +886,7 @@ impl PluginStore { } /// Removes the plugin with the given name from the store. - pub fn unregister(&mut self, plugin: &'static str) -> bool { + pub fn unregister(&mut self, plugin: &str) -> bool { let len = self.store.len(); self.store.retain(|p| p.name() != plugin); len != self.store.len()