Skip to content

Commit 1f7cdc2

Browse files
Fix nightly clippy warnings
1 parent 8c56dc4 commit 1f7cdc2

File tree

8 files changed

+16
-16
lines changed

8 files changed

+16
-16
lines changed

gio/src/datagram_based.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -91,7 +91,7 @@ impl<O: IsA<DatagramBased>> DatagramBasedExtManual for O {
9191
)
9292
.into_glib()
9393
}
94-
unsafe extern "C" fn destroy_closure<O, F>(ptr: glib::ffi::gpointer) {
94+
unsafe extern "C" fn destroy_closure<F>(ptr: glib::ffi::gpointer) {
9595
let _ = Box::<RefCell<F>>::from_raw(ptr as *mut _);
9696
}
9797
let cancellable = cancellable.map(|c| c.as_ref());
@@ -110,7 +110,7 @@ impl<O: IsA<DatagramBased>> DatagramBasedExtManual for O {
110110
unsafe extern "C" fn(glib::ffi::gpointer) -> glib::ffi::gboolean,
111111
>(trampoline)),
112112
Box::into_raw(Box::new(RefCell::new(func))) as glib::ffi::gpointer,
113-
Some(destroy_closure::<O, F>),
113+
Some(destroy_closure::<F>),
114114
);
115115
glib::ffi::g_source_set_priority(source, priority.into_glib());
116116

gio/src/pollable_input_stream.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -78,7 +78,7 @@ impl<O: IsA<PollableInputStream>> PollableInputStreamExtManual for O {
7878
let mut func = func.borrow_mut();
7979
(*func)(PollableInputStream::from_glib_borrow(stream).unsafe_cast_ref()).into_glib()
8080
}
81-
unsafe extern "C" fn destroy_closure<O, F>(ptr: glib::ffi::gpointer) {
81+
unsafe extern "C" fn destroy_closure<F>(ptr: glib::ffi::gpointer) {
8282
let _ = Box::<RefCell<F>>::from_raw(ptr as *mut _);
8383
}
8484
let cancellable = cancellable.map(|c| c.as_ref());
@@ -97,7 +97,7 @@ impl<O: IsA<PollableInputStream>> PollableInputStreamExtManual for O {
9797
unsafe extern "C" fn(glib::ffi::gpointer) -> glib::ffi::gboolean,
9898
>(trampoline)),
9999
Box::into_raw(Box::new(RefCell::new(func))) as glib::ffi::gpointer,
100-
Some(destroy_closure::<Self, F>),
100+
Some(destroy_closure::<F>),
101101
);
102102
glib::ffi::g_source_set_priority(source, priority.into_glib());
103103

gio/src/pollable_output_stream.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -84,7 +84,7 @@ impl<O: IsA<PollableOutputStream>> PollableOutputStreamExtManual for O {
8484
let mut func = func.borrow_mut();
8585
(*func)(PollableOutputStream::from_glib_borrow(stream).unsafe_cast_ref()).into_glib()
8686
}
87-
unsafe extern "C" fn destroy_closure<O, F>(ptr: glib::ffi::gpointer) {
87+
unsafe extern "C" fn destroy_closure<F>(ptr: glib::ffi::gpointer) {
8888
let _ = Box::<RefCell<F>>::from_raw(ptr as *mut _);
8989
}
9090
let cancellable = cancellable.map(|c| c.as_ref());
@@ -103,7 +103,7 @@ impl<O: IsA<PollableOutputStream>> PollableOutputStreamExtManual for O {
103103
unsafe extern "C" fn(glib::ffi::gpointer) -> glib::ffi::gboolean,
104104
>(trampoline)),
105105
Box::into_raw(Box::new(RefCell::new(func))) as glib::ffi::gpointer,
106-
Some(destroy_closure::<Self, F>),
106+
Some(destroy_closure::<F>),
107107
);
108108
glib::ffi::g_source_set_priority(source, priority.into_glib());
109109

gio/src/socket.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -794,7 +794,7 @@ impl<O: IsA<Socket>> SocketExtManual for O {
794794
)
795795
.into_glib()
796796
}
797-
unsafe extern "C" fn destroy_closure<O, F>(ptr: glib::ffi::gpointer) {
797+
unsafe extern "C" fn destroy_closure<F>(ptr: glib::ffi::gpointer) {
798798
let _ = Box::<RefCell<F>>::from_raw(ptr as *mut _);
799799
}
800800
let cancellable = cancellable.map(|c| c.as_ref());
@@ -813,7 +813,7 @@ impl<O: IsA<Socket>> SocketExtManual for O {
813813
unsafe extern "C" fn(glib::ffi::gpointer) -> glib::ffi::gboolean,
814814
>(trampoline)),
815815
Box::into_raw(Box::new(RefCell::new(func))) as glib::ffi::gpointer,
816-
Some(destroy_closure::<O, F>),
816+
Some(destroy_closure::<F>),
817817
);
818818
glib::ffi::g_source_set_priority(source, priority.into_glib());
819819

gio/src/subclass/async_initable.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -89,7 +89,7 @@ unsafe impl<T: AsyncInitableImpl> IsImplementable<T> for AsyncInitable {
8989
fn interface_init(iface: &mut glib::Interface<Self>) {
9090
let iface = iface.as_mut();
9191
iface.init_async = Some(async_initable_init_async::<T>);
92-
iface.init_finish = Some(async_initable_init_finish::<T>);
92+
iface.init_finish = Some(async_initable_init_finish);
9393
}
9494
}
9595

@@ -136,7 +136,7 @@ unsafe extern "C" fn async_initable_init_async<T: AsyncInitableImpl>(
136136
});
137137
}
138138

139-
unsafe extern "C" fn async_initable_init_finish<T: AsyncInitableImpl>(
139+
unsafe extern "C" fn async_initable_init_finish(
140140
initable: *mut ffi::GAsyncInitable,
141141
res: *mut ffi::GAsyncResult,
142142
error: *mut *mut glib::ffi::GError,

glib/src/functions.rs

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -34,14 +34,14 @@ pub fn spawn_async_with_fds<P: AsRef<std::path::Path>, T: AsRawFd, U: AsRawFd, V
3434
stderr_fd: V,
3535
) -> Result<Pid, Error> {
3636
let child_setup_data: Box_<Option<Box_<dyn FnOnce() + 'static>>> = Box_::new(child_setup);
37-
unsafe extern "C" fn child_setup_func<P: AsRef<std::path::Path>>(user_data: ffi::gpointer) {
37+
unsafe extern "C" fn child_setup_func(user_data: ffi::gpointer) {
3838
let callback: Box_<Option<Box_<dyn FnOnce() + 'static>>> =
3939
Box_::from_raw(user_data as *mut _);
4040
let callback = (*callback).expect("cannot get closure...");
4141
callback()
4242
}
4343
let child_setup = if child_setup_data.is_some() {
44-
Some(child_setup_func::<P> as _)
44+
Some(child_setup_func as _)
4545
} else {
4646
None
4747
};
@@ -144,14 +144,14 @@ pub fn spawn_async_with_pipes<
144144
child_setup: Option<Box_<dyn FnOnce() + 'static>>,
145145
) -> Result<(Pid, T, U, V), Error> {
146146
let child_setup_data: Box_<Option<Box_<dyn FnOnce() + 'static>>> = Box_::new(child_setup);
147-
unsafe extern "C" fn child_setup_func<P: AsRef<std::path::Path>>(user_data: ffi::gpointer) {
147+
unsafe extern "C" fn child_setup_func(user_data: ffi::gpointer) {
148148
let callback: Box_<Option<Box_<dyn FnOnce() + 'static>>> =
149149
Box_::from_raw(user_data as *mut _);
150150
let callback = (*callback).expect("cannot get closure...");
151151
callback()
152152
}
153153
let child_setup = if child_setup_data.is_some() {
154-
Some(child_setup_func::<P> as _)
154+
Some(child_setup_func as _)
155155
} else {
156156
None
157157
};

glib/src/param_spec.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -707,7 +707,7 @@ macro_rules! define_builder {
707707
}
708708

709709
impl $rust_type {
710-
pub fn builder<'a>(name: &'a str, $($($req_ident: $req_ty),*)?) -> $builder_type<'a> {
710+
pub fn builder(name: &str, $($($req_ident: $req_ty),*)?) -> $builder_type<'_> {
711711
$builder_type::new(name, $($($req_ident),*)?)
712712
}
713713
}

pango/src/attribute.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -111,7 +111,7 @@ macro_rules! define_attribute_struct {
111111

112112
impl $rust_type {
113113
#[doc(alias = "pango_attribute_equal")]
114-
fn equal<'a, T: crate::attribute::IsAttribute>(&self, attr2: &'a T) -> bool {
114+
fn equal<T: crate::attribute::IsAttribute>(&self, attr2: &T) -> bool {
115115
unsafe {
116116
glib::translate::from_glib(ffi::pango_attribute_equal(self.as_ptr() as *const ffi::PangoAttribute,
117117
glib::translate::ToGlibPtr::to_glib_none(attr2.upcast_ref()).0,

0 commit comments

Comments
 (0)