Skip to content
This repository has been archived by the owner on Jun 8, 2021. It is now read-only.

Commit

Permalink
Merge pull request #695 from sdroege/fragile
Browse files Browse the repository at this point in the history
Switch from send-cell to fragile
  • Loading branch information
GuillaumeGomez committed Sep 6, 2018
2 parents b17cc04 + 08f7a45 commit 732ea2b
Show file tree
Hide file tree
Showing 5 changed files with 14 additions and 14 deletions.
4 changes: 2 additions & 2 deletions Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@ v3_16 = ["v3_14", "gtk-sys/v3_16", "gdk/v3_16", "gio/v2_44"]
v3_10 = ["v3_8", "gtk-sys/v3_10", "gdk/v3_10"]
v3_14 = ["v3_12", "gtk-sys/v3_14", "gdk/v3_14"]
dox = ["gdk/dox", "gtk-sys/dox"]
futures = ["futures-core-preview", "send-cell", "gio/futures"]
futures = ["futures-core-preview", "fragile", "gio/futures"]

[target.'cfg(target_os = "macos")'.build-dependencies]
cc = "^1.0"
Expand All @@ -54,7 +54,7 @@ git = "https://github.com/gtk-rs/lgpl-docs"
libc = "0.2"
bitflags = "1.0"
lazy_static = "1.0"
send-cell = { version = "0.1", optional = true }
fragile = { version = "0.3", optional = true }
futures-core-preview = { version = "0.2", optional = true }

cairo-sys-rs = { git = "https://github.com/gtk-rs/cairo" }
Expand Down
2 changes: 1 addition & 1 deletion gir
Submodule gir updated 1 files
+3 −3 src/codegen/function.rs
18 changes: 9 additions & 9 deletions src/auto/icon_info.rs
Original file line number Diff line number Diff line change
Expand Up @@ -194,12 +194,12 @@ impl<O: IsA<IconInfo> + IsA<glib::object::Object> + Clone + 'static> IconInfoExt
#[cfg(any(feature = "v3_8", feature = "dox"))]
fn load_icon_async_future(&self) -> Box_<futures_core::Future<Item = (Self, gdk_pixbuf::Pixbuf), Error = (Self, Error)>> {
use gio::GioFuture;
use send_cell::SendCell;
use fragile::Fragile;

GioFuture::new(self, move |obj, send| {
let cancellable = gio::Cancellable::new();
let send = SendCell::new(send);
let obj_clone = SendCell::new(obj.clone());
let send = Fragile::new(send);
let obj_clone = Fragile::new(obj.clone());
obj.load_icon_async(
Some(&cancellable),
move |res| {
Expand Down Expand Up @@ -269,7 +269,7 @@ impl<O: IsA<IconInfo> + IsA<glib::object::Object> + Clone + 'static> IconInfoExt
#[cfg(any(feature = "v3_8", feature = "dox"))]
fn load_symbolic_async_future<'a, 'b, 'c, P: Into<Option<&'a gdk::RGBA>>, Q: Into<Option<&'b gdk::RGBA>>, R: Into<Option<&'c gdk::RGBA>>>(&self, fg: &gdk::RGBA, success_color: P, warning_color: Q, error_color: R) -> Box_<futures_core::Future<Item = (Self, (gdk_pixbuf::Pixbuf, bool)), Error = (Self, Error)>> {
use gio::GioFuture;
use send_cell::SendCell;
use fragile::Fragile;

let fg = fg.clone();
let success_color = success_color.into();
Expand All @@ -280,8 +280,8 @@ impl<O: IsA<IconInfo> + IsA<glib::object::Object> + Clone + 'static> IconInfoExt
let error_color = error_color.map(ToOwned::to_owned);
GioFuture::new(self, move |obj, send| {
let cancellable = gio::Cancellable::new();
let send = SendCell::new(send);
let obj_clone = SendCell::new(obj.clone());
let send = Fragile::new(send);
let obj_clone = Fragile::new(obj.clone());
obj.load_symbolic_async(
&fg,
success_color.as_ref().map(::std::borrow::Borrow::borrow),
Expand Down Expand Up @@ -332,13 +332,13 @@ impl<O: IsA<IconInfo> + IsA<glib::object::Object> + Clone + 'static> IconInfoExt
#[cfg(any(feature = "v3_8", feature = "dox"))]
fn load_symbolic_for_context_async_future(&self, context: &StyleContext) -> Box_<futures_core::Future<Item = (Self, (gdk_pixbuf::Pixbuf, bool)), Error = (Self, Error)>> {
use gio::GioFuture;
use send_cell::SendCell;
use fragile::Fragile;

let context = context.clone();
GioFuture::new(self, move |obj, send| {
let cancellable = gio::Cancellable::new();
let send = SendCell::new(send);
let obj_clone = SendCell::new(obj.clone());
let send = Fragile::new(send);
let obj_clone = Fragile::new(obj.clone());
obj.load_symbolic_for_context_async(
&context,
Some(&cancellable),
Expand Down
2 changes: 1 addition & 1 deletion src/auto/versions.txt
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
Generated by gir (https://github.com/gtk-rs/gir @ d3116ca)
Generated by gir (https://github.com/gtk-rs/gir @ f5fca82)
from gir-files (https://github.com/gtk-rs/gir-files @ b8f5ef1)
2 changes: 1 addition & 1 deletion src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -174,7 +174,7 @@ extern crate cairo;
extern crate pango;

#[cfg(feature = "futures")]
extern crate send_cell;
extern crate fragile;
#[cfg(feature = "futures")]
extern crate futures_core;

Expand Down

0 comments on commit 732ea2b

Please sign in to comment.