Skip to content

Commit d84c93c

Browse files
Merge pull request gtk-rs#11 from sdroege/gio-futures-without-fragile
Regenerate with latest gir
2 parents a234bfe + d291652 commit d84c93c

File tree

5 files changed

+11
-26
lines changed

5 files changed

+11
-26
lines changed

Cargo.toml

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -39,7 +39,6 @@ git = "https://github.com/gtk-rs/lgpl-docs"
3939
libc = "0.2"
4040
bitflags = "1.0"
4141
lazy_static = "1.0"
42-
fragile = { version = "0.3" }
4342
atk = { git = "https://github.com/gtk-rs/atk" }
4443
atk-sys = { git = "https://github.com/gtk-rs/sys" }
4544
cairo-sys-rs = { git = "https://github.com/gtk-rs/cairo" }

src/auto/icon_info.rs

Lines changed: 9 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -114,18 +114,14 @@ impl IconInfo {
114114
) -> Pin<
115115
Box_<dyn std::future::Future<Output = Result<gdk_pixbuf::Pixbuf, glib::Error>> + 'static>,
116116
> {
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| {
121118
let cancellable = gio::Cancellable::new();
122-
let send = Fragile::new(send);
123119
obj.load_icon_async(Some(&cancellable), move |res| {
124-
let _ = send.into_inner().send(res);
120+
send.resolve(res);
125121
});
126122

127123
cancellable
128-
})
124+
}))
129125
}
130126

131127
pub fn load_symbolic(
@@ -220,29 +216,25 @@ impl IconInfo {
220216
+ 'static,
221217
>,
222218
> {
223-
use fragile::Fragile;
224-
use gio::GioFuture;
225-
226219
let fg = fg.clone();
227220
let success_color = success_color.map(ToOwned::to_owned);
228221
let warning_color = warning_color.map(ToOwned::to_owned);
229222
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| {
231224
let cancellable = gio::Cancellable::new();
232-
let send = Fragile::new(send);
233225
obj.load_symbolic_async(
234226
&fg,
235227
success_color.as_ref().map(::std::borrow::Borrow::borrow),
236228
warning_color.as_ref().map(::std::borrow::Borrow::borrow),
237229
error_color.as_ref().map(::std::borrow::Borrow::borrow),
238230
Some(&cancellable),
239231
move |res| {
240-
let _ = send.into_inner().send(res);
232+
send.resolve(res);
241233
},
242234
);
243235

244236
cancellable
245-
})
237+
}))
246238
}
247239

248240
pub fn load_symbolic_for_context<P: IsA<StyleContext>>(
@@ -323,19 +315,15 @@ impl IconInfo {
323315
+ 'static,
324316
>,
325317
> {
326-
use fragile::Fragile;
327-
use gio::GioFuture;
328-
329318
let context = context.clone();
330-
GioFuture::new(self, move |obj, send| {
319+
Box_::pin(gio::GioFuture::new(self, move |obj, send| {
331320
let cancellable = gio::Cancellable::new();
332-
let send = Fragile::new(send);
333321
obj.load_symbolic_for_context_async(&context, Some(&cancellable), move |res| {
334-
let _ = send.into_inner().send(res);
322+
send.resolve(res);
335323
});
336324

337325
cancellable
338-
})
326+
}))
339327
}
340328

341329
pub fn load_texture(&self) -> Option<gdk::Texture> {

src/auto/versions.txt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,2 +1,2 @@
1-
Generated by gir (https://github.com/gtk-rs/gir @ 6c8c7c4)
1+
Generated by gir (https://github.com/gtk-rs/gir @ 8335272)
22
from gir-files (https://github.com/gtk-rs/gir-files @ 22748fa)

src/lib.rs

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -40,8 +40,6 @@ extern crate graphene;
4040
extern crate gsk4 as gsk;
4141
extern crate pango;
4242

43-
extern crate fragile;
44-
4543
pub const STYLE_PROVIDER_PRIORITY_FALLBACK: u32 =
4644
gtk_sys::GTK_STYLE_PROVIDER_PRIORITY_FALLBACK as u32;
4745
pub const STYLE_PROVIDER_PRIORITY_THEME: u32 = gtk_sys::GTK_STYLE_PROVIDER_PRIORITY_THEME as u32;

0 commit comments

Comments
 (0)