-
-
Notifications
You must be signed in to change notification settings - Fork 101
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
Generate code for new from_glib_borrow signature #895
Merged
Merged
Conversation
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Seems correct to me. :) |
Good to go for me, GStreamer builds. Just need to clean up some more things there. |
EPashkin
reviewed
Apr 5, 2020
Git part looks good, but glib#605 IMHO need rebase and fix From ba8dd46c1731b0e897aaddb3eb799c303731c240 Mon Sep 17 00:00:00 2001
From: Evgenii Pashkin <eapashkin@gmail.com>
Date: Sun, 5 Apr 2020 16:16:26 +0300
Subject: [PATCH] tmp
---
src/log.rs | 12 ++++++------
src/main_context_futures.rs | 4 ++--
2 files changed, 8 insertions(+), 8 deletions(-)
diff --git a/src/log.rs b/src/log.rs
index 2edd728..54eabdd 100644
--- a/src/log.rs
+++ b/src/log.rs
@@ -128,8 +128,8 @@ pub fn log_set_handler<P: Fn(&str, LogLevel, &str) + Send + Sync + 'static>(
message: *const libc::c_char,
user_data: glib_sys::gpointer,
) {
- let log_domain: GString = from_glib_borrow(log_domain);
- let message: GString = from_glib_borrow(message);
+ let log_domain: Borrowed<GString> = from_glib_borrow(log_domain);
+ let message: Borrowed<GString> = from_glib_borrow(message);
let callback: &P = &*(user_data as *mut _);
(*callback)(log_domain.as_str(), from_glib(log_level), message.as_str());
}
@@ -192,7 +192,7 @@ pub fn set_print_handler<P: Fn(&str) + Send + Sync + 'static>(func: P) {
Some(ref handler) => Some(Arc::clone(handler)),
None => None,
} {
- let string: GString = from_glib_borrow(string);
+ let string: Borrowed<GString> = from_glib_borrow(string);
(*callback)(string.as_str())
}
}
@@ -223,7 +223,7 @@ pub fn set_printerr_handler<P: Fn(&str) + Send + Sync + 'static>(func: P) {
Some(ref handler) => Some(Arc::clone(handler)),
None => None,
} {
- let string: GString = from_glib_borrow(string);
+ let string: Borrowed<GString> = from_glib_borrow(string);
(*callback)(string.as_str())
}
}
@@ -260,8 +260,8 @@ pub fn log_set_default_handler<P: Fn(&str, LogLevel, &str) + Send + Sync + 'stat
Some(ref handler) => Some(Arc::clone(handler)),
None => None,
} {
- let log_domain: GString = from_glib_borrow(log_domain);
- let message: GString = from_glib_borrow(message);
+ let log_domain: Borrowed<GString> = from_glib_borrow(log_domain);
+ let message: Borrowed<GString> = from_glib_borrow(message);
(*callback)(log_domain.as_str(), from_glib(log_levels), message.as_str());
}
}
diff --git a/src/main_context_futures.rs b/src/main_context_futures.rs
index 33fe809..5df38bb 100644
--- a/src/main_context_futures.rs
+++ b/src/main_context_futures.rs
@@ -10,7 +10,7 @@ use glib_sys;
use std::mem;
use std::pin;
use std::ptr;
-use translate::{from_glib_borrow, from_glib_full, mut_override, ToGlib};
+use translate::{from_glib_borrow, from_glib_full, mut_override, ToGlib, Borrowed};
use ThreadGuard;
use MainContext;
@@ -194,7 +194,7 @@ impl TaskSource {
fn poll(&mut self) -> Poll<()> {
let source = &self.source as *const _;
- let executor: MainContext =
+ let executor: Borrowed<MainContext> =
unsafe { from_glib_borrow(glib_sys::g_source_get_context(mut_override(source))) };
assert!(
--
2.25.1
|
Yes, I'm going to update that and all the other crates once this is merged. |
Not need to wait CI, it will fail anyway. |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
See gtk-rs/glib#605
This works fine for glib, gio, gdk, gdk-pixbuf, pango, pangocairo and gtk (I have local branches for all of them that I will submit once this is merged). Please review but don't merge until I've also checked GStreamer :)