@@ -20,7 +20,7 @@ pub trait Clipboard {
2020 /// Reads the current content of the [`Clipboard`] as text.
2121 fn read_data (
2222 & self ,
23- kind : Kind ,
23+ _kind : Kind ,
2424 _mimes : Vec < String > ,
2525 ) -> Option < ( Vec < u8 > , String ) > {
2626 None
@@ -29,7 +29,7 @@ pub trait Clipboard {
2929 /// Writes the given contents to the [`Clipboard`].
3030 fn write_data (
3131 & mut self ,
32- kind : Kind ,
32+ _kind : Kind ,
3333 _contents : ClipboardStoreData <
3434 Box < dyn Send + Sync + ' static + mime:: AsMimeTypes > ,
3535 > ,
@@ -70,7 +70,7 @@ pub trait Clipboard {
7070 }
7171
7272 /// Request window size
73- fn request_logical_window_size ( & self , width : f32 , height : f32 ) { }
73+ fn request_logical_window_size ( & self , _width : f32 , _height : f32 ) { }
7474}
7575
7676/// The kind of [`Clipboard`].
@@ -141,10 +141,7 @@ pub fn peek_dnd<T: AllowedMimeTypes>(
141141 clipboard : & mut dyn Clipboard ,
142142 mime : Option < String > ,
143143) -> Option < T > {
144- let Some ( mime) = mime. or_else ( || T :: allowed ( ) . first ( ) . cloned ( ) . into ( ) )
145- else {
146- return None ;
147- } ;
144+ let mime = mime. or_else ( || T :: allowed ( ) . first ( ) . cloned ( ) ) ?;
148145 clipboard
149146 . peek_dnd ( mime)
150147 . and_then ( |data| T :: try_from ( data) . ok ( ) )
@@ -160,7 +157,7 @@ pub enum DndSource {
160157}
161158
162159/// A list of DnD destination rectangles.
163- #[ derive( Debug , Clone ) ]
160+ #[ derive( Debug , Clone , Default ) ]
164161pub struct DndDestinationRectangles {
165162 /// The rectangle of the DnD destination.
166163 rectangles : Vec < DndDestinationRectangle > ,
@@ -169,9 +166,7 @@ pub struct DndDestinationRectangles {
169166impl DndDestinationRectangles {
170167 /// Creates a new [`DndDestinationRectangles`].
171168 pub fn new ( ) -> Self {
172- Self {
173- rectangles : Vec :: new ( ) ,
174- }
169+ Self :: default ( )
175170 }
176171
177172 /// Creates a new [`DndDestinationRectangles`] with the given capacity.
0 commit comments