mirror of
https://github.com/servo/servo.git
synced 2025-08-07 06:25:32 +01:00
Address issues uncovered by rust-1.78 beta (#32130)
This change makes changes to allow Servo to compile with the 1.78 version of Rust: - Dead code is removd (Rust seems to have gotten better at detecting it). - The `FlowRef` `DerefMut` is updated according to @SimonSapin's advice [^1]. - The `imports.rs` now explicitly silences warnings about unused imports. [^1]: https://github.com/servo/servo/issues/6503#issuecomment-2066088179 <!-- Please describe your changes on the following line: --> --- <!-- Thank you for contributing to Servo! Please replace each `[ ]` by `[X]` when the step is complete, and replace `___` with appropriate data: --> - [x] `./mach build -d` does not report any errors - [x] `./mach test-tidy` does not report any errors - [x] These changes do not require tests because they should not change behavior. <!-- Also, please make sure that "Allow edits from maintainers" checkbox is checked, so that we can help you if you get stuck somewhere along the way.--> <!-- Pull requests that do not address these steps are welcome, but they will require additional verification as part of the review process. -->
This commit is contained in:
parent
f65010c97d
commit
a0640c8524
16 changed files with 6 additions and 146 deletions
|
@ -283,10 +283,6 @@ impl WindowPortsMethods for Window {
|
|||
std::mem::take(&mut *self.event_queue.borrow_mut())
|
||||
}
|
||||
|
||||
fn has_events(&self) -> bool {
|
||||
!self.event_queue.borrow().is_empty()
|
||||
}
|
||||
|
||||
fn device_hidpi_factor(&self) -> Scale<f32, DeviceIndependentPixel, DevicePixel> {
|
||||
Scale::new(self.winit_window.scale_factor() as f32)
|
||||
}
|
||||
|
|
|
@ -69,14 +69,6 @@ impl WindowPortsMethods for Window {
|
|||
}
|
||||
}
|
||||
|
||||
fn has_events(&self) -> bool {
|
||||
self.event_queue
|
||||
.read()
|
||||
.ok()
|
||||
.map(|queue| !queue.is_empty())
|
||||
.unwrap_or(false)
|
||||
}
|
||||
|
||||
fn id(&self) -> winit::window::WindowId {
|
||||
unsafe { winit::window::WindowId::dummy() }
|
||||
}
|
||||
|
|
|
@ -21,7 +21,6 @@ pub const LINE_HEIGHT: f32 = 38.0;
|
|||
pub trait WindowPortsMethods: WindowMethods {
|
||||
fn get_events(&self) -> Vec<EmbedderEvent>;
|
||||
fn id(&self) -> winit::window::WindowId;
|
||||
fn has_events(&self) -> bool;
|
||||
fn hidpi_factor(&self) -> Scale<f32, DeviceIndependentPixel, DevicePixel> {
|
||||
self.device_pixel_ratio_override()
|
||||
.unwrap_or_else(|| match opts::get().output_file {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue