mirror of
https://github.com/servo/servo.git
synced 2025-08-27 08:08:19 +01:00
Update Servo::get_events to return drain type (#31181)
* Update Servo::get_events to return drain type to prevent constant allocation * Remove type alias for tlwc * Fix libsimpleservo
This commit is contained in:
parent
21dbf0ad3a
commit
266a082206
4 changed files with 23 additions and 12 deletions
|
@ -462,7 +462,7 @@ impl App {
|
|||
|
||||
// Take any new embedder messages from Servo itself.
|
||||
embedder_messages = self.servo.as_mut().unwrap().get_events();
|
||||
if embedder_messages.is_empty() {
|
||||
if embedder_messages.len() == 0 {
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
|
|
@ -7,6 +7,7 @@ use std::fs::File;
|
|||
use std::io::Write;
|
||||
use std::rc::Rc;
|
||||
use std::time::Duration;
|
||||
use std::vec::Drain;
|
||||
use std::{env, thread};
|
||||
|
||||
use arboard::Clipboard;
|
||||
|
@ -292,7 +293,7 @@ where
|
|||
/// Returns true if the caller needs to manually present a new frame.
|
||||
pub fn handle_servo_events(
|
||||
&mut self,
|
||||
events: Vec<(Option<WebViewId>, EmbedderMsg)>,
|
||||
events: Drain<'_, (Option<WebViewId>, EmbedderMsg)>,
|
||||
) -> ServoEventResponse {
|
||||
let mut need_present = false;
|
||||
let mut history_changed = false;
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue