Skip to content
Closed
Show file tree
Hide file tree
Changes from 5 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions gdk-pixbuf/src/auto/pixbuf.rs
Original file line number Diff line number Diff line change
Expand Up @@ -160,7 +160,7 @@ impl Pixbuf {

#[doc(alias = "gdk_pixbuf_new_from_xpm_data")]
#[doc(alias = "new_from_xpm_data")]
pub fn from_xpm_data(data: &[&str]) -> Pixbuf {
pub fn from_xpm_data(data: &[impl AsRef<str>]) -> Pixbuf {
unsafe { from_glib_full(ffi::gdk_pixbuf_new_from_xpm_data(data.to_glib_none().0)) }
}

Expand Down Expand Up @@ -479,7 +479,7 @@ impl Pixbuf {
//}

//#[doc(alias = "gdk_pixbuf_save_to_callbackv")]
//pub fn save_to_callbackv<P: FnMut(&Vec<u8>, usize, &glib::Error) -> bool>(&self, save_func: P, type_: &str, option_keys: &[&str], option_values: &[&str]) -> Result<(), glib::Error> {
//pub fn save_to_callbackv<P: FnMut(&Vec<u8>, usize, &glib::Error) -> bool>(&self, save_func: P, type_: &str, option_keys: &[impl AsRef<str>], option_values: &[impl AsRef<str>]) -> Result<(), glib::Error> {
// unsafe { TODO: call ffi:gdk_pixbuf_save_to_callbackv() }
//}

Expand Down
2 changes: 1 addition & 1 deletion gdk-pixbuf/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 @ 41ab88c)
Generated by gir (https://github.com/gtk-rs/gir @ b823540+)
from gir-files (https://github.com/gtk-rs/gir-files @ 6088bb6)
2 changes: 1 addition & 1 deletion gdk-pixbuf/sys/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 @ 41ab88c)
Generated by gir (https://github.com/gtk-rs/gir @ b823540+)
from gir-files (https://github.com/gtk-rs/gir-files @ 6088bb6)
18 changes: 12 additions & 6 deletions gio/src/app_info.rs
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ pub trait AppInfoExtManual: 'static {
R: FnOnce(Result<(), glib::Error>) + Send + 'static,
>(
&self,
uris: &[&str],
uris: &[impl AsRef<str>],
context: Option<&P>,
cancellable: Option<&Q>,
callback: R,
Expand All @@ -37,7 +37,7 @@ pub trait AppInfoExtManual: 'static {
#[cfg_attr(feature = "dox", doc(cfg(feature = "v2_60")))]
fn launch_uris_async_future<P: IsA<AppLaunchContext> + Clone + 'static>(
&self,
uris: &[&str],
uris: &[impl AsRef<str>],
context: Option<&P>,
) -> Pin<Box_<dyn std::future::Future<Output = Result<(), glib::Error>> + 'static>>;
}
Expand All @@ -51,7 +51,7 @@ impl<O: IsA<AppInfo>> AppInfoExtManual for O {
R: FnOnce(Result<(), glib::Error>) + Send + 'static,
>(
&self,
uris: &[&str],
uris: &[impl AsRef<str>],
context: Option<&P>,
cancellable: Option<&Q>,
callback: R,
Expand Down Expand Up @@ -80,7 +80,7 @@ impl<O: IsA<AppInfo>> AppInfoExtManual for O {
unsafe {
ffi::g_app_info_launch_uris_async(
self.as_ref().to_glib_none().0,
uris.to_glib_none().0,
uris.as_ref().to_glib_none().0,
context.map(|p| p.as_ref()).to_glib_none().0,
cancellable.map(|p| p.as_ref()).to_glib_none().0,
Some(callback),
Expand All @@ -93,10 +93,16 @@ impl<O: IsA<AppInfo>> AppInfoExtManual for O {
#[cfg_attr(feature = "dox", doc(cfg(feature = "v2_60")))]
fn launch_uris_async_future<P: IsA<AppLaunchContext> + Clone + 'static>(
&self,
uris: &[&str],
uris: &[impl AsRef<str>],
context: Option<&P>,
) -> Pin<Box_<dyn std::future::Future<Output = Result<(), glib::Error>> + 'static>> {
let uris = uris.iter().copied().map(String::from).collect::<Vec<_>>();
let uris = uris
.as_ref()
.iter()
.map(|v| v.as_ref())
.copied()
.map(String::from)
.collect::<Vec<_>>();
let context = context.map(ToOwned::to_owned);
Box_::pin(crate::GioFuture::new(self, move |obj, send| {
let cancellable = Cancellable::new();
Expand Down
4 changes: 2 additions & 2 deletions gio/src/application.rs
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ pub trait ApplicationExtManual {
#[doc(alias = "g_application_run")]
fn run(&self) -> i32;
#[doc(alias = "g_application_run")]
fn run_with_args<S: AsRef<str>>(&self, args: &[S]) -> i32;
fn run_with_args(&self, args: &[impl AsRef<str>]) -> i32;
fn connect_open<F: Fn(&Self, &[File], &str) + 'static>(&self, f: F) -> SignalHandlerId;
}

Expand All @@ -23,7 +23,7 @@ impl<O: IsA<Application>> ApplicationExtManual for O {
self.run_with_args(&std::env::args().collect::<Vec<_>>())
}

fn run_with_args<S: AsRef<str>>(&self, args: &[S]) -> i32 {
fn run_with_args(&self, args: &[impl AsRef<str>]) -> i32 {
let argv: Vec<&str> = args.iter().map(|a| a.as_ref()).collect();
let argc = argv.len() as i32;
unsafe {
Expand Down
4 changes: 2 additions & 2 deletions gio/src/auto/app_info.rs
Original file line number Diff line number Diff line change
Expand Up @@ -268,7 +268,7 @@ pub trait AppInfoExt: 'static {
#[doc(alias = "g_app_info_launch_uris")]
fn launch_uris<P: IsA<AppLaunchContext>>(
&self,
uris: &[&str],
uris: &[impl AsRef<str>],
context: Option<&P>,
) -> Result<(), glib::Error>;

Expand Down Expand Up @@ -418,7 +418,7 @@ impl<O: IsA<AppInfo>> AppInfoExt for O {

fn launch_uris<P: IsA<AppLaunchContext>>(
&self,
uris: &[&str],
uris: &[impl AsRef<str>],
context: Option<&P>,
) -> Result<(), glib::Error> {
unsafe {
Expand Down
2 changes: 1 addition & 1 deletion gio/src/auto/desktop_app_info.rs
Original file line number Diff line number Diff line change
Expand Up @@ -209,7 +209,7 @@ impl DesktopAppInfo {
#[doc(alias = "g_desktop_app_info_launch_uris_as_manager")]
pub fn launch_uris_as_manager<P: IsA<AppLaunchContext>>(
&self,
uris: &[&str],
uris: &[impl AsRef<str>],
launch_context: Option<&P>,
spawn_flags: glib::SpawnFlags,
user_setup: Option<Box_<dyn FnOnce() + 'static>>,
Expand Down
2 changes: 1 addition & 1 deletion gio/src/auto/file_info.rs
Original file line number Diff line number Diff line change
Expand Up @@ -399,7 +399,7 @@ impl FileInfo {
}

#[doc(alias = "g_file_info_set_attribute_stringv")]
pub fn set_attribute_stringv(&self, attribute: &str, attr_value: &[&str]) {
pub fn set_attribute_stringv(&self, attribute: &str, attr_value: &[impl AsRef<str>]) {
unsafe {
ffi::g_file_info_set_attribute_stringv(
self.to_glib_none().0,
Expand Down
2 changes: 1 addition & 1 deletion gio/src/auto/functions.rs
Original file line number Diff line number Diff line change
Expand Up @@ -235,7 +235,7 @@ pub fn content_type_is_unknown(type_: &str) -> bool {
#[cfg(any(feature = "v2_60", feature = "dox"))]
#[cfg_attr(feature = "dox", doc(cfg(feature = "v2_60")))]
#[doc(alias = "g_content_type_set_mime_dirs")]
pub fn content_type_set_mime_dirs(dirs: &[&str]) {
pub fn content_type_set_mime_dirs(dirs: &[impl AsRef<str>]) {
unsafe {
ffi::g_content_type_set_mime_dirs(dirs.to_glib_none().0);
}
Expand Down
4 changes: 2 additions & 2 deletions gio/src/auto/settings.rs
Original file line number Diff line number Diff line change
Expand Up @@ -228,7 +228,7 @@ pub trait SettingsExt: 'static {
fn set_string(&self, key: &str, value: &str) -> Result<(), glib::error::BoolError>;

#[doc(alias = "g_settings_set_strv")]
fn set_strv(&self, key: &str, value: &[&str]) -> Result<(), glib::error::BoolError>;
fn set_strv(&self, key: &str, value: &[impl AsRef<str>]) -> Result<(), glib::error::BoolError>;

#[doc(alias = "g_settings_set_uint")]
fn set_uint(&self, key: &str, value: u32) -> Result<(), glib::error::BoolError>;
Expand Down Expand Up @@ -561,7 +561,7 @@ impl<O: IsA<Settings>> SettingsExt for O {
}
}

fn set_strv(&self, key: &str, value: &[&str]) -> Result<(), glib::error::BoolError> {
fn set_strv(&self, key: &str, value: &[impl AsRef<str>]) -> Result<(), glib::error::BoolError> {
unsafe {
glib::result_from_gboolean!(
ffi::g_settings_set_strv(
Expand Down
4 changes: 2 additions & 2 deletions gio/src/auto/settings_backend.rs
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@ pub trait SettingsBackendExt: 'static {
//fn changed_tree(&self, tree: /*Ignored*/&glib::Tree, origin_tag: /*Unimplemented*/Option<Fundamental: Pointer>);

//#[doc(alias = "g_settings_backend_keys_changed")]
//fn keys_changed(&self, path: &str, items: &[&str], origin_tag: /*Unimplemented*/Option<Fundamental: Pointer>);
//fn keys_changed(&self, path: &str, items: &[impl AsRef<str>], origin_tag: /*Unimplemented*/Option<Fundamental: Pointer>);

//#[doc(alias = "g_settings_backend_path_changed")]
//fn path_changed(&self, path: &str, origin_tag: /*Unimplemented*/Option<Fundamental: Pointer>);
Expand All @@ -58,7 +58,7 @@ impl<O: IsA<SettingsBackend>> SettingsBackendExt for O {
// unsafe { TODO: call ffi:g_settings_backend_changed_tree() }
//}

//fn keys_changed(&self, path: &str, items: &[&str], origin_tag: /*Unimplemented*/Option<Fundamental: Pointer>) {
//fn keys_changed(&self, path: &str, items: &[impl AsRef<str>], origin_tag: /*Unimplemented*/Option<Fundamental: Pointer>) {
// unsafe { TODO: call ffi:g_settings_backend_keys_changed() }
//}

Expand Down
2 changes: 1 addition & 1 deletion gio/src/auto/themed_icon.rs
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ impl ThemedIcon {

#[doc(alias = "g_themed_icon_new_from_names")]
#[doc(alias = "new_from_names")]
pub fn from_names(iconnames: &[&str]) -> ThemedIcon {
pub fn from_names(iconnames: &[impl AsRef<str>]) -> ThemedIcon {
let len = iconnames.len() as i32;
unsafe {
from_glib_full(ffi::g_themed_icon_new_from_names(
Expand Down
4 changes: 2 additions & 2 deletions gio/src/auto/tls_connection.rs
Original file line number Diff line number Diff line change
Expand Up @@ -94,7 +94,7 @@ pub trait TlsConnectionExt: 'static {
#[cfg(any(feature = "v2_60", feature = "dox"))]
#[cfg_attr(feature = "dox", doc(cfg(feature = "v2_60")))]
#[doc(alias = "g_tls_connection_set_advertised_protocols")]
fn set_advertised_protocols(&self, protocols: &[&str]);
fn set_advertised_protocols(&self, protocols: &[impl AsRef<str>]);

#[doc(alias = "g_tls_connection_set_certificate")]
fn set_certificate<P: IsA<TlsCertificate>>(&self, certificate: &P);
Expand Down Expand Up @@ -314,7 +314,7 @@ impl<O: IsA<TlsConnection>> TlsConnectionExt for O {

#[cfg(any(feature = "v2_60", feature = "dox"))]
#[cfg_attr(feature = "dox", doc(cfg(feature = "v2_60")))]
fn set_advertised_protocols(&self, protocols: &[&str]) {
fn set_advertised_protocols(&self, protocols: &[impl AsRef<str>]) {
unsafe {
ffi::g_tls_connection_set_advertised_protocols(
self.as_ref().to_glib_none().0,
Expand Down
2 changes: 1 addition & 1 deletion gio/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 @ 41ab88c)
Generated by gir (https://github.com/gtk-rs/gir @ b823540+)
from gir-files (https://github.com/gtk-rs/gir-files @ 6088bb6)
6 changes: 3 additions & 3 deletions gio/src/desktop_app_info.rs
Original file line number Diff line number Diff line change
Expand Up @@ -56,7 +56,7 @@ pub trait DesktopAppInfoExtManual {
V: AsRawFd,
>(
&self,
uris: &[&str],
uris: &[impl AsRef<str>],
launch_context: Option<&P>,
spawn_flags: glib::SpawnFlags,
user_setup: Option<Box_<dyn FnOnce() + 'static>>,
Expand All @@ -77,7 +77,7 @@ impl<O: IsA<DesktopAppInfo>> DesktopAppInfoExtManual for O {
V: AsRawFd,
>(
&self,
uris: &[&str],
uris: &[impl AsRef<str>],
launch_context: Option<&P>,
spawn_flags: glib::SpawnFlags,
user_setup: Option<Box_<dyn FnOnce() + 'static>>,
Expand Down Expand Up @@ -129,7 +129,7 @@ impl<O: IsA<DesktopAppInfo>> DesktopAppInfoExtManual for O {
let mut error = ptr::null_mut();
let _ = ffi::g_desktop_app_info_launch_uris_as_manager_with_fds(
self.as_ref().to_glib_none().0,
uris.to_glib_none().0,
uris.as_ref().to_glib_none().0,
launch_context.map(|p| p.as_ref()).to_glib_none().0,
spawn_flags.into_glib(),
user_setup,
Expand Down
2 changes: 1 addition & 1 deletion gio/sys/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 @ 41ab88c)
Generated by gir (https://github.com/gtk-rs/gir @ b823540+)
from gir-files (https://github.com/gtk-rs/gir-files @ 6088bb6)
2 changes: 1 addition & 1 deletion glib/gobject-sys/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 @ 41ab88c)
Generated by gir (https://github.com/gtk-rs/gir @ b823540+)
from gir-files (https://github.com/gtk-rs/gir-files @ 6088bb6)
2 changes: 1 addition & 1 deletion glib/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 @ 41ab88c)
Generated by gir (https://github.com/gtk-rs/gir @ b823540+)
from gir-files (https://github.com/gtk-rs/gir-files @ 6088bb6)
11 changes: 8 additions & 3 deletions glib/src/functions.rs
Original file line number Diff line number Diff line change
Expand Up @@ -27,10 +27,15 @@ use std::ptr;
#[cfg_attr(feature = "dox", doc(cfg(all(feature = "v2_58", not(windows)))))]
#[allow(clippy::too_many_arguments)]
#[doc(alias = "g_spawn_async_with_fds")]
pub fn spawn_async_with_fds<P: AsRef<std::path::Path>, T: AsRawFd, U: AsRawFd, V: AsRawFd>(
pub fn spawn_async_with_fds<
P: AsRef<std::path::Path>,
T: AsRawFd,
U: AsRawFd,
V: AsRawFd,
>(
working_directory: P,
argv: &[&str],
envp: &[&str],
argv: &[impl AsRef<str>],
envp: &[impl AsRef<str>],
flags: SpawnFlags,
child_setup: Option<Box_<dyn FnOnce() + 'static>>,
stdin_fd: T,
Expand Down
2 changes: 1 addition & 1 deletion glib/sys/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 @ 41ab88c)
Generated by gir (https://github.com/gtk-rs/gir @ b823540+)
from gir-files (https://github.com/gtk-rs/gir-files @ 6088bb6)
2 changes: 1 addition & 1 deletion graphene/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 @ 41ab88c)
Generated by gir (https://github.com/gtk-rs/gir @ b823540+)
from gir-files (https://github.com/gtk-rs/gir-files @ 6088bb6)
2 changes: 1 addition & 1 deletion graphene/sys/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 @ 41ab88c)
Generated by gir (https://github.com/gtk-rs/gir @ b823540+)
from gir-files (https://github.com/gtk-rs/gir-files @ 6088bb6)
2 changes: 1 addition & 1 deletion pango/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 @ 41ab88c)
Generated by gir (https://github.com/gtk-rs/gir @ b823540+)
from gir-files (https://github.com/gtk-rs/gir-files @ 6088bb6)
2 changes: 1 addition & 1 deletion pango/sys/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 @ 41ab88c)
Generated by gir (https://github.com/gtk-rs/gir @ b823540+)
from gir-files (https://github.com/gtk-rs/gir-files @ 6088bb6)
2 changes: 1 addition & 1 deletion pangocairo/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 @ 41ab88c)
Generated by gir (https://github.com/gtk-rs/gir @ b823540+)
from gir-files (https://github.com/gtk-rs/gir-files @ 6088bb6)
2 changes: 1 addition & 1 deletion pangocairo/sys/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 @ 41ab88c)
Generated by gir (https://github.com/gtk-rs/gir @ b823540+)
from gir-files (https://github.com/gtk-rs/gir-files @ 6088bb6)