Notable things I've had to fix due to 1.78:
- Better detection of unused items
- New clippy lint (`assigning_clones`) that points out places where assignment operations with clone rhs could be replaced with more performant `clone_into`
Release Notes:

- N/A
This commit is contained in:
Piotr Osiewicz
2024-05-05 15:02:50 +02:00
committed by GitHub
parent 9ec0927701
commit 1a9b0536a2
41 changed files with 49 additions and 433 deletions
@@ -199,10 +199,6 @@ impl<P: LinuxClient + 'static> Platform for P {
self.displays()
}
fn display(&self, id: DisplayId) -> Option<Rc<dyn PlatformDisplay>> {
self.display(id)
}
// todo(linux)
fn active_window(&self) -> Option<AnyWindowHandle> {
None
@@ -306,18 +302,6 @@ impl<P: LinuxClient + 'static> Platform for P {
open::that(dir);
}
fn on_become_active(&self, callback: Box<dyn FnMut()>) {
self.with_common(|common| {
common.callbacks.become_active = Some(callback);
});
}
fn on_resign_active(&self, callback: Box<dyn FnMut()>) {
self.with_common(|common| {
common.callbacks.resign_active = Some(callback);
});
}
fn on_quit(&self, callback: Box<dyn FnMut()>) {
self.with_common(|common| {
common.callbacks.quit = Some(callback);
@@ -330,12 +314,6 @@ impl<P: LinuxClient + 'static> Platform for P {
});
}
fn on_event(&self, callback: Box<dyn FnMut(PlatformInput) -> bool>) {
self.with_common(|common| {
common.callbacks.event = Some(callback);
});
}
fn on_app_menu_action(&self, callback: Box<dyn FnMut(&dyn Action)>) {
self.with_common(|common| {
common.callbacks.app_menu_action = Some(callback);
@@ -580,10 +580,6 @@ impl PlatformWindow for WaylandWindow {
crate::Modifiers::default()
}
fn as_any_mut(&mut self) -> &mut dyn Any {
self
}
fn set_input_handler(&mut self, input_handler: PlatformInputHandler) {
self.borrow_mut().input_handler = Some(input_handler);
}
@@ -668,10 +664,6 @@ impl PlatformWindow for WaylandWindow {
self.0.callbacks.borrow_mut().resize = Some(callback);
}
fn on_fullscreen(&self, callback: Box<dyn FnMut(bool)>) {
self.0.callbacks.borrow_mut().fullscreen = Some(callback);
}
fn on_moved(&self, callback: Box<dyn FnMut()>) {
self.0.callbacks.borrow_mut().moved = Some(callback);
}
@@ -688,11 +680,6 @@ impl PlatformWindow for WaylandWindow {
// todo(linux)
}
// todo(linux)
fn is_topmost_for_position(&self, position: Point<Pixels>) -> bool {
false
}
fn draw(&self, scene: &Scene) {
let mut state = self.borrow_mut();
state.renderer.draw(scene);
@@ -460,10 +460,6 @@ impl PlatformWindow for X11Window {
Modifiers::default()
}
fn as_any_mut(&mut self) -> &mut dyn std::any::Any {
self
}
fn set_input_handler(&mut self, input_handler: PlatformInputHandler) {
self.0.state.borrow_mut().input_handler = Some(input_handler);
}
@@ -587,10 +583,6 @@ impl PlatformWindow for X11Window {
self.0.callbacks.borrow_mut().resize = Some(callback);
}
fn on_fullscreen(&self, callback: Box<dyn FnMut(bool)>) {
self.0.callbacks.borrow_mut().fullscreen = Some(callback);
}
fn on_moved(&self, callback: Box<dyn FnMut()>) {
self.0.callbacks.borrow_mut().moved = Some(callback);
}
@@ -607,11 +599,6 @@ impl PlatformWindow for X11Window {
self.0.callbacks.borrow_mut().appearance_changed = Some(callback);
}
// todo(linux)
fn is_topmost_for_position(&self, _position: Point<Pixels>) -> bool {
unimplemented!()
}
fn draw(&self, scene: &Scene) {
let mut inner = self.0.state.borrow_mut();
inner.renderer.draw(scene);