Simplify the implementation of the message buffering (#2123)

* Simplify the implementation of the message buffering

* Add assert to ensure list is empty
This commit is contained in:
James Lindsay
2024-12-02 20:48:33 +00:00
committed by GitHub
parent e3bb11ec1b
commit b21b1cbfc7
3 changed files with 47 additions and 26 deletions
+1 -1
View File
@@ -16,7 +16,7 @@ impl Editor {
}
pub fn handle_message<T: Into<Message>>(&mut self, message: T) -> Vec<FrontendMessage> {
self.dispatcher.handle_message(message);
self.dispatcher.handle_message(message, true);
std::mem::take(&mut self.dispatcher.responses)
}