summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorAram Drevekenin <aram@poor.dev>2023-05-16 00:37:25 +0200
committerAram Drevekenin <aram@poor.dev>2023-05-16 00:37:25 +0200
commit99fd314a692a356d8f6865f39730753137f1b0d9 (patch)
tree752a210c1af8e9f84a6611be036feb958f0f276e
parentd726323055bfca37abdb1c661e97f68c81840161 (diff)
style(fmt): rustfmt
-rw-r--r--default-plugins/fixture-plugin-for-tests/src/main.rs10
-rw-r--r--zellij-server/src/plugins/plugin_loader.rs9
-rw-r--r--zellij-server/src/plugins/wasm_bridge.rs10
-rw-r--r--zellij-tile/src/lib.rs2
4 files changed, 21 insertions, 10 deletions
diff --git a/default-plugins/fixture-plugin-for-tests/src/main.rs b/default-plugins/fixture-plugin-for-tests/src/main.rs
index 486f4ea93..124b2dc75 100644
--- a/default-plugins/fixture-plugin-for-tests/src/main.rs
+++ b/default-plugins/fixture-plugin-for-tests/src/main.rs
@@ -13,14 +13,20 @@ struct State {
#[derive(Default, Serialize, Deserialize)]
struct TestWorker {
- number_of_messages_received: usize
+ number_of_messages_received: usize,
}
impl<'de> ZellijWorker<'de> for TestWorker {
fn on_message(&mut self, message: String, payload: String) {
if message == "ping" {
self.number_of_messages_received += 1;
- post_message_to_plugin("pong".into(), format!("{}, received {} messages", payload, self.number_of_messages_received));
+ post_message_to_plugin(
+ "pong".into(),
+ format!(
+ "{}, received {} messages",
+ payload, self.number_of_messages_received
+ ),
+ );
}
}
}
diff --git a/zellij-server/src/plugins/plugin_loader.rs b/zellij-server/src/plugins/plugin_loader.rs
index 5e98a2bfd..91eb6c93e 100644
--- a/zellij-server/src/plugins/plugin_loader.rs
+++ b/zellij-server/src/plugins/plugin_loader.rs
@@ -615,8 +615,13 @@ impl<'a> PluginLoader<'a> {
let (instance, plugin_env) =
self.create_plugin_instance_and_wasi_env_for_worker()?;
- let start_function_for_worker = instance.exports.get_function("_start").with_context(err_context)?;
- start_function_for_worker.call(&[]).with_context(err_context)?;
+ let start_function_for_worker = instance
+ .exports
+ .get_function("_start")
+ .with_context(err_context)?;
+ start_function_for_worker
+ .call(&[])
+ .with_context(err_context)?;
let worker =
RunningWorker::new(instance, &function_name, plugin_config, plugin_env);
diff --git a/zellij-server/src/plugins/wasm_bridge.rs b/zellij-server/src/plugins/wasm_bridge.rs
index 5d180b7d9..0015552c1 100644
--- a/zellij-server/src/plugins/wasm_bridge.rs
+++ b/zellij-server/src/plugins/wasm_bridge.rs
@@ -142,11 +142,11 @@ impl WasmBridge {
) {
Ok(_) => handle_plugin_successful_loading(&senders, plugin_id),
Err(e) => handle_plugin_loading_failure(
- &senders,
- plugin_id,
- &mut loading_indication,
- e,
- )
+ &senders,
+ plugin_id,
+ &mut loading_indication,
+ e,
+ ),
}
let _ =
senders.send_to_plugin(PluginInstruction::ApplyCachedEvents(vec![plugin_id]));
diff --git a/zellij-tile/src/lib.rs b/zellij-tile/src/lib.rs
index 4292d3bf3..685de4afe 100644
--- a/zellij-tile/src/lib.rs
+++ b/zellij-tile/src/lib.rs
@@ -46,7 +46,7 @@ macro_rules! register_plugin {
}
#[no_mangle]
- fn load () {
+ fn load() {
STATE.with(|state| {
state.borrow_mut().load();
});