Skip to content

Commit

Permalink
fix: fix clippy error
Browse files Browse the repository at this point in the history
  • Loading branch information
Juliandev02 committed Oct 12, 2024
1 parent 9499964 commit 3d52334
Showing 1 changed file with 2 additions and 34 deletions.
36 changes: 2 additions & 34 deletions src/commands/plugin.rs
Original file line number Diff line number Diff line change
@@ -1,35 +1,3 @@
use stblib::external::plugin::{Plugin, PluginProperties};

pub struct ExamplePlugin;

impl Plugin for ExamplePlugin {
fn execute(&self, args: &[String]) {
match args.first().unwrap().as_str() {
"test" => {
println!("Example plugin")
},
"foo" => {
println!("Bar!")
}
_ => self.help()
}
}

fn help(&self) {
println!("Example help message")
}
}

#[allow(improper_ctypes_definitions)]
#[no_mangle]
pub extern "C" fn create_plugin() -> (Box<dyn Plugin>, PluginProperties) {
let properties: PluginProperties = PluginProperties {
name: "Example Plugin",
id: "example-plugin",
package_id: "com.example.exampleplugin",
version: env!("CARGO_PKG_VERSION"),
library_version: stblib::VERSION,
};

(Box::new(ExamplePlugin), properties)
pub fn plugin() {

}

0 comments on commit 3d52334

Please sign in to comment.