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
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
41 changed files with 49 additions and 433 deletions

View file

@ -1,9 +1,9 @@
use super::{events::key_to_native, BoolExt};
use crate::{
Action, AnyWindowHandle, BackgroundExecutor, ClipboardItem, CursorStyle, DisplayId,
ForegroundExecutor, Keymap, MacDispatcher, MacDisplay, MacTextSystem, MacWindow, Menu,
MenuItem, PathPromptOptions, Platform, PlatformDisplay, PlatformInput, PlatformTextSystem,
PlatformWindow, Result, SemanticVersion, Task, WindowAppearance, WindowParams,
Action, AnyWindowHandle, BackgroundExecutor, ClipboardItem, CursorStyle, ForegroundExecutor,
Keymap, MacDispatcher, MacDisplay, MacTextSystem, MacWindow, Menu, MenuItem, PathPromptOptions,
Platform, PlatformDisplay, PlatformInput, PlatformTextSystem, PlatformWindow, Result,
SemanticVersion, Task, WindowAppearance, WindowParams,
};
use anyhow::{anyhow, bail};
use block::ConcreteBlock;
@ -487,10 +487,6 @@ impl Platform for MacPlatform {
.collect()
}
fn display(&self, id: DisplayId) -> Option<Rc<dyn PlatformDisplay>> {
MacDisplay::find_by_id(id).map(|screen| Rc::new(screen) as Rc<_>)
}
fn active_window(&self) -> Option<AnyWindowHandle> {
MacWindow::active_window()
}
@ -679,14 +675,6 @@ impl Platform for MacPlatform {
}
}
fn on_become_active(&self, callback: Box<dyn FnMut()>) {
self.0.lock().become_active = Some(callback);
}
fn on_resign_active(&self, callback: Box<dyn FnMut()>) {
self.0.lock().resign_active = Some(callback);
}
fn on_quit(&self, callback: Box<dyn FnMut()>) {
self.0.lock().quit = Some(callback);
}
@ -695,10 +683,6 @@ impl Platform for MacPlatform {
self.0.lock().reopen = Some(callback);
}
fn on_event(&self, callback: Box<dyn FnMut(PlatformInput) -> bool>) {
self.0.lock().event = Some(callback);
}
fn on_app_menu_action(&self, callback: Box<dyn FnMut(&dyn Action)>) {
self.0.lock().menu_command = Some(callback);
}