Skip to content

Commit a4b53e3

Browse files
ZanderBrownbilelmoussaoui
authored andcommitted
gtk: Don't propogate unused argument
Unlike the C version we are emulating, we dont set any ‘arguments’, and in any case they have little value in a language with native closures It's therefore plain confusing to require users to accept this second parameter that will *always* be `None` Fix: #1590 See: #1542
1 parent ef50ef8 commit a4b53e3

File tree

1 file changed

+3
-7
lines changed

1 file changed

+3
-7
lines changed

gtk4/src/subclass/widget.rs

Lines changed: 3 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1008,11 +1008,7 @@ pub unsafe trait WidgetClassExt: ClassStruct {
10081008

10091009
#[doc(alias = "gtk_widget_class_add_binding")]
10101010
fn add_binding<
1011-
F: Fn(
1012-
&<<Self as ClassStruct>::Type as ObjectSubclass>::Type,
1013-
Option<&Variant>,
1014-
) -> glib::Propagation
1015-
+ 'static,
1011+
F: Fn(&<<Self as ClassStruct>::Type as ObjectSubclass>::Type) -> glib::Propagation + 'static,
10161012
>(
10171013
&mut self,
10181014
keyval: gdk::Key,
@@ -1022,8 +1018,8 @@ pub unsafe trait WidgetClassExt: ClassStruct {
10221018
let shortcut = crate::Shortcut::new(
10231019
Some(crate::KeyvalTrigger::new(keyval, mods)),
10241020
Some(crate::CallbackAction::new(
1025-
move |widget, args| -> glib::Propagation {
1026-
unsafe { callback(widget.unsafe_cast_ref(), args) }
1021+
move |widget, _| -> glib::Propagation {
1022+
unsafe { callback(widget.unsafe_cast_ref()) }
10271023
},
10281024
)),
10291025
);

0 commit comments

Comments
 (0)