Remove unnecessary enqueue step

pull/639/head
Arijit Basu 11 months ago
parent 048b1c701a
commit cae50e4bcf
No known key found for this signature in database
GPG Key ID: 0F8EF5258DC38077

@ -424,11 +424,6 @@ impl App {
.unwrap_or_default()
}
fn enqueue(mut self, task: Task) -> Self {
self.msg_out.push_back(MsgOut::Enque(task));
self
}
pub fn handle_batch_external_msgs(mut self, msgs: Vec<ExternalMsg>) -> Result<Self> {
for task in msgs
.into_iter()
@ -670,7 +665,7 @@ impl App {
});
for msg in msgs {
self = self.enqueue(Task::new(MsgIn::External(msg), Some(key)));
self = self.handle_external(msg, Some(key))?;
}
Ok(self)

@ -1,6 +1,6 @@
use serde::{Deserialize, Serialize};
use crate::app::{Command, Task};
use crate::app::Command;
#[derive(Debug, Clone, Eq, PartialEq, Serialize, Deserialize)]
pub enum MsgOut {
@ -17,7 +17,6 @@ pub enum MsgOut {
CallLuaSilently(String),
LuaEval(String),
LuaEvalSilently(String),
Enque(Task),
EnableMouse,
DisableMouse,
ToggleMouse,

@ -349,12 +349,6 @@ impl Runner {
while let Some(msg) = app.msg_out.pop_front() {
use app::MsgOut::*;
match msg {
// NOTE: Do not schedule critical tasks via tx_msg_in in this loop.
// Try handling them immediately.
Enque(task) => {
tx_msg_in.send(task)?;
}
Quit => {
result = Ok(None);
break 'outer;

Loading…
Cancel
Save