refactor: remove Sized bound
This commit is contained in:
parent
7c59b07b91
commit
1832d5637b
6 changed files with 6 additions and 8 deletions
|
|
@ -189,9 +189,7 @@ pub enum Icon {
|
||||||
}
|
}
|
||||||
|
|
||||||
#[derive(Clone)]
|
#[derive(Clone)]
|
||||||
pub struct DndSurface(
|
pub struct DndSurface(pub Arc<dyn HasWindowHandle + 'static + Send + Sync>);
|
||||||
pub Arc<Box<dyn HasWindowHandle + 'static + Send + Sync>>,
|
|
||||||
);
|
|
||||||
|
|
||||||
impl Debug for DndSurface {
|
impl Debug for DndSurface {
|
||||||
fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
|
fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
|
||||||
|
|
|
||||||
|
|
@ -62,7 +62,7 @@ pub struct PlatformClipboard<C> {
|
||||||
|
|
||||||
impl PlatformClipboard<platform::Clipboard> {
|
impl PlatformClipboard<platform::Clipboard> {
|
||||||
/// Safety: the display handle must be valid for the lifetime of `Clipboard`
|
/// Safety: the display handle must be valid for the lifetime of `Clipboard`
|
||||||
pub unsafe fn connect<W: HasDisplayHandle>(
|
pub unsafe fn connect<W: HasDisplayHandle + ?Sized>(
|
||||||
window: &W,
|
window: &W,
|
||||||
) -> Result<Self, Box<dyn Error>> {
|
) -> Result<Self, Box<dyn Error>> {
|
||||||
Ok(PlatformClipboard {
|
Ok(PlatformClipboard {
|
||||||
|
|
|
||||||
|
|
@ -3,7 +3,7 @@ use crate::ClipboardProvider;
|
||||||
use raw_window_handle::HasDisplayHandle;
|
use raw_window_handle::HasDisplayHandle;
|
||||||
use std::error::Error;
|
use std::error::Error;
|
||||||
|
|
||||||
pub fn connect<W: HasDisplayHandle>(
|
pub fn connect<W: HasDisplayHandle + ?Sized>(
|
||||||
_window: &W,
|
_window: &W,
|
||||||
) -> Result<Clipboard, Box<dyn Error>> {
|
) -> Result<Clipboard, Box<dyn Error>> {
|
||||||
Clipboard::new()
|
Clipboard::new()
|
||||||
|
|
|
||||||
|
|
@ -201,7 +201,7 @@ impl DndProvider for Clipboard {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
pub unsafe fn connect<W: HasDisplayHandle>(
|
pub unsafe fn connect<W: HasDisplayHandle + ?Sized>(
|
||||||
window: &W,
|
window: &W,
|
||||||
) -> Result<Clipboard, Box<dyn Error>> {
|
) -> Result<Clipboard, Box<dyn Error>> {
|
||||||
let clipboard = match window.display_handle()?.as_raw() {
|
let clipboard = match window.display_handle()?.as_raw() {
|
||||||
|
|
|
||||||
|
|
@ -7,7 +7,7 @@ use mime::{AllowedMimeTypes, AsMimeTypes};
|
||||||
use raw_window_handle::HasDisplayHandle;
|
use raw_window_handle::HasDisplayHandle;
|
||||||
use std::{borrow::Cow, error::Error};
|
use std::{borrow::Cow, error::Error};
|
||||||
|
|
||||||
pub fn connect<W: HasDisplayHandle>(
|
pub fn connect<W: HasDisplayHandle + ?Sized>(
|
||||||
_window: &W,
|
_window: &W,
|
||||||
) -> Result<Clipboard, Box<dyn Error>> {
|
) -> Result<Clipboard, Box<dyn Error>> {
|
||||||
Clipboard::new()
|
Clipboard::new()
|
||||||
|
|
|
||||||
|
|
@ -7,7 +7,7 @@ use mime::{AllowedMimeTypes, AsMimeTypes};
|
||||||
use raw_window_handle::HasDisplayHandle;
|
use raw_window_handle::HasDisplayHandle;
|
||||||
use std::{borrow::Cow, error::Error};
|
use std::{borrow::Cow, error::Error};
|
||||||
|
|
||||||
pub fn connect<W: HasDisplayHandle>(
|
pub fn connect<W: HasDisplayHandle + ?Sized>(
|
||||||
_window: &W,
|
_window: &W,
|
||||||
) -> Result<Clipboard, Box<dyn Error>> {
|
) -> Result<Clipboard, Box<dyn Error>> {
|
||||||
Ok(Clipboard)
|
Ok(Clipboard)
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue