@@ -114,18 +114,14 @@ impl IconInfo {
114
114
) -> Pin <
115
115
Box_ < dyn std:: future:: Future < Output = Result < gdk_pixbuf:: Pixbuf , glib:: Error > > + ' static > ,
116
116
> {
117
- use fragile:: Fragile ;
118
- use gio:: GioFuture ;
119
-
120
- GioFuture :: new ( self , move |obj, send| {
117
+ Box_ :: pin ( gio:: GioFuture :: new ( self , move |obj, send| {
121
118
let cancellable = gio:: Cancellable :: new ( ) ;
122
- let send = Fragile :: new ( send) ;
123
119
obj. load_icon_async ( Some ( & cancellable) , move |res| {
124
- let _ = send. into_inner ( ) . send ( res) ;
120
+ send. resolve ( res) ;
125
121
} ) ;
126
122
127
123
cancellable
128
- } )
124
+ } ) )
129
125
}
130
126
131
127
pub fn load_symbolic (
@@ -220,29 +216,25 @@ impl IconInfo {
220
216
+ ' static ,
221
217
> ,
222
218
> {
223
- use fragile:: Fragile ;
224
- use gio:: GioFuture ;
225
-
226
219
let fg = fg. clone ( ) ;
227
220
let success_color = success_color. map ( ToOwned :: to_owned) ;
228
221
let warning_color = warning_color. map ( ToOwned :: to_owned) ;
229
222
let error_color = error_color. map ( ToOwned :: to_owned) ;
230
- GioFuture :: new ( self , move |obj, send| {
223
+ Box_ :: pin ( gio :: GioFuture :: new ( self , move |obj, send| {
231
224
let cancellable = gio:: Cancellable :: new ( ) ;
232
- let send = Fragile :: new ( send) ;
233
225
obj. load_symbolic_async (
234
226
& fg,
235
227
success_color. as_ref ( ) . map ( :: std:: borrow:: Borrow :: borrow) ,
236
228
warning_color. as_ref ( ) . map ( :: std:: borrow:: Borrow :: borrow) ,
237
229
error_color. as_ref ( ) . map ( :: std:: borrow:: Borrow :: borrow) ,
238
230
Some ( & cancellable) ,
239
231
move |res| {
240
- let _ = send. into_inner ( ) . send ( res) ;
232
+ send. resolve ( res) ;
241
233
} ,
242
234
) ;
243
235
244
236
cancellable
245
- } )
237
+ } ) )
246
238
}
247
239
248
240
pub fn load_symbolic_for_context < P : IsA < StyleContext > > (
@@ -323,19 +315,15 @@ impl IconInfo {
323
315
+ ' static ,
324
316
> ,
325
317
> {
326
- use fragile:: Fragile ;
327
- use gio:: GioFuture ;
328
-
329
318
let context = context. clone ( ) ;
330
- GioFuture :: new ( self , move |obj, send| {
319
+ Box_ :: pin ( gio :: GioFuture :: new ( self , move |obj, send| {
331
320
let cancellable = gio:: Cancellable :: new ( ) ;
332
- let send = Fragile :: new ( send) ;
333
321
obj. load_symbolic_for_context_async ( & context, Some ( & cancellable) , move |res| {
334
- let _ = send. into_inner ( ) . send ( res) ;
322
+ send. resolve ( res) ;
335
323
} ) ;
336
324
337
325
cancellable
338
- } )
326
+ } ) )
339
327
}
340
328
341
329
pub fn load_texture ( & self ) -> Option < gdk:: Texture > {
0 commit comments