Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Don't box callbacks and other generic parameters twice in async funct… #186

Merged
merged 1 commit into from Jan 29, 2019

Conversation

Projects
None yet
2 participants
@sdroege
Copy link
Member

sdroege commented Jan 28, 2019

…ions and signals

And also use GString to prevent some string copies.


This will fail to build until the regen is done.

@sdroege sdroege force-pushed the sdroege:single-boxed-signals-async branch 2 times, most recently from cd14175 to 43a7e12 Jan 28, 2019

@EPashkin

This comment has been minimized.

Copy link
Member

EPashkin commented Jan 28, 2019

Found one typo

error[E0412]: cannot find type `R` in this scope
   --> D:/eap/rust/0/gio\src\output_stream.rs:101:36
    |
101 |         let user_data: Box<Option<(R, B)>> = Box::new(Some((callback, buffer)));
    |                                    ^ did you mean `B`?

@EPashkin

This comment has been minimized.

Copy link
Member

EPashkin commented Jan 28, 2019

and one error on stable:

   Compiling gio v0.5.1 (D:\eap\rust\0\gio)
error[E0277]: expected a `std::ops::FnOnce<(std::result::Result<(std::string::String, std::string::String), glib::Error>,)>` closure, found `R`
  --> D:/eap/rust/0/gio\src\subprocess.rs:46:24
   |
46 |         let callback = communicate_utf8_async_trampoline::<R>;
   |                        ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ expected an `FnOnce<(std::result::Result<(std::string::String, std::string::String), glib::Error>,)>` closure, found `R`
   |
   = help: the trait `std::ops::FnOnce<(std::result::Result<(std::string::String, std::string::String), glib::Error>,)>` is not implemented for `R`
   = help: consider adding a `where R: std::ops::FnOnce<(std::result::Result<(std::string::String, std::string::String), glib::Error>,)>` bound
note: required by `subprocess::<impl auto::subprocess::Subprocess>::communicate_utf8_async::communicate_utf8_async_trampoline`
  --> D:/eap/rust/0/gio\src\subprocess.rs:35:9
   |
35 |         unsafe extern "C" fn communicate_utf8_async_trampoline<R: FnOnce(Result<(String, String), Error>) + Send + 'static>(_source_object: *mut gobject_ffi::GObject, res: *mut ffi::GAsyncResult, user_data: glib_ffi::gpointer)
   |         ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^

@EPashkin

This comment has been minimized.

Copy link
Member

EPashkin commented Jan 28, 2019

Other that this 2 typos 👍 from me, Thanks @sdroege

@sdroege sdroege force-pushed the sdroege:single-boxed-signals-async branch from 43a7e12 to 3970d43 Jan 28, 2019

@sdroege

This comment has been minimized.

Copy link
Member Author

sdroege commented Jan 28, 2019

Should both be solved now, thanks!

Show resolved Hide resolved src/subprocess.rs Outdated
Don't box callbacks and other generic parameters twice in async funct…
…ions and signals

And also use GString to prevent some string copies.

@sdroege sdroege force-pushed the sdroege:single-boxed-signals-async branch from 3970d43 to 938f7d3 Jan 28, 2019

@EPashkin

This comment has been minimized.

Copy link
Member

EPashkin commented Jan 28, 2019

👍

@sdroege sdroege merged commit 3c3aa13 into gtk-rs:master Jan 29, 2019

2 checks passed

continuous-integration/appveyor/pr AppVeyor build succeeded
Details
continuous-integration/travis-ci/pr The Travis CI build passed
Details
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.