Skip to content

Commit

Permalink
Cargo fmt
Browse files Browse the repository at this point in the history
  • Loading branch information
kazimuth committed Jul 25, 2023
1 parent 722f6ca commit 7d2971d
Show file tree
Hide file tree
Showing 2 changed files with 22 additions and 6 deletions.
14 changes: 11 additions & 3 deletions crates/core/src/host/module_host.rs
Original file line number Diff line number Diff line change
Expand Up @@ -248,7 +248,11 @@ impl ModuleHostCommand {
ModuleHostCommand::StopTrace { respond_to } => {
let _ = respond_to.send(actor.stop_trace());
}
ModuleHostCommand::InjectLogs { respond_to, log_level, message } => actor.inject_logs(respond_to, log_level, message),
ModuleHostCommand::InjectLogs {
respond_to,
log_level,
message,
} => actor.inject_logs(respond_to, log_level, message),
}
}
}
Expand Down Expand Up @@ -503,8 +507,12 @@ impl ModuleHost {
}

pub async fn inject_logs(&self, log_level: LogLevel, message: String) -> Result<(), NoSuchModule> {
self.call(|respond_to| ModuleHostCommand::InjectLogs { respond_to, log_level, message })
.await
self.call(|respond_to| ModuleHostCommand::InjectLogs {
respond_to,
log_level,
message,
})
.await
}

pub fn downgrade(&self) -> WeakModuleHost {
Expand Down
14 changes: 11 additions & 3 deletions crates/core/src/host/wasm_common/module_host_actor.rs
Original file line number Diff line number Diff line change
Expand Up @@ -408,7 +408,11 @@ impl<T: WasmModule> ModuleHostActor for WasmModuleHostActor<T> {
}

fn inject_logs(&self, respond_to: oneshot::Sender<()>, log_level: LogLevel, message: String) {
self.instances.send(InstanceMessage::InjectLogs { respond_to, log_level, message })
self.instances.send(InstanceMessage::InjectLogs {
respond_to,
log_level,
message,
})
}

fn close(self) {
Expand Down Expand Up @@ -488,7 +492,11 @@ impl<T: WasmInstance> JobRunner for WasmInstanceActor<T> {
InstanceMessage::UpdateDatabase { respond_to } => {
let _ = respond_to.send(self.update_database());
}
InstanceMessage::InjectLogs { respond_to, log_level, message } => {
InstanceMessage::InjectLogs {
respond_to,
log_level,
message,
} => {
let _ = respond_to.send(self.instance.instance_env().console_log(
log_level,
&Record {
Expand All @@ -499,7 +507,7 @@ impl<T: WasmInstance> JobRunner for WasmInstanceActor<T> {
},
&(),
));
},
}
}
if self.trapped {
ControlFlow::Break(())
Expand Down

0 comments on commit 7d2971d

Please sign in to comment.