Skip to content

Commit

Permalink
feat: Allow str and String for plugin name
Browse files Browse the repository at this point in the history
  • Loading branch information
DashieTM committed Mar 22, 2024
1 parent 0a43920 commit bc09acf
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 3 deletions.
2 changes: 1 addition & 1 deletion src/tests.rs
Original file line number Diff line number Diff line change
Expand Up @@ -109,5 +109,5 @@ fn test_custom_tests() {
let func1 = PluginTestFunc::new(func1, "henlo");
let func2 = PluginTestFunc::new(func2, "fail");
let funcs = vec![func1, func2];
plugin_tests("libtest",funcs);
plugin_tests(String::from("libtest"), funcs);
}
4 changes: 2 additions & 2 deletions src/utils/plugin.rs
Original file line number Diff line number Diff line change
Expand Up @@ -116,7 +116,7 @@ impl FnOnce<()> for PluginTestFunc {
unsafe impl Send for PluginTestFunc {}
unsafe impl Sync for PluginTestFunc {}

pub fn plugin_tests(plugig_name: &'static str, tests: Vec<PluginTestFunc>) {
pub fn plugin_tests(plugin_name: impl AsRef<str>, tests: Vec<PluginTestFunc>) {
use std::thread;

let mut running = String::from("");
Expand Down Expand Up @@ -146,7 +146,7 @@ pub fn plugin_tests(plugig_name: &'static str, tests: Vec<PluginTestFunc>) {
let mut buffer = String::from("");
buffer += &format!(
"\n----------- Plugin Tests for {} -----------\n\n",
plugig_name
plugin_name.as_ref()
);
buffer += &format!("running {} tests:\n", running_index);
buffer += &running;
Expand Down

0 comments on commit bc09acf

Please sign in to comment.