@@ -13,9 +13,9 @@ pub struct WatcherId(NonZeroU32);
13
13
14
14
fn own_closure < F > ( f : F ) -> glib:: Closure
15
15
where
16
- F : Fn ( DBusConnection , & str ) + Send + Sync + ' static ,
16
+ F : Fn ( DBusConnection , & str ) + ' static ,
17
17
{
18
- glib:: Closure :: new ( move |args| {
18
+ glib:: Closure :: new_local ( move |args| {
19
19
let conn = args[ 0 ] . get :: < DBusConnection > ( ) . unwrap ( ) ;
20
20
let name = args[ 1 ] . get :: < & str > ( ) . unwrap ( ) ;
21
21
f ( conn, name) ;
25
25
26
26
fn appeared_closure < F > ( f : F ) -> glib:: Closure
27
27
where
28
- F : Fn ( DBusConnection , & str , & str ) + Send + Sync + ' static ,
28
+ F : Fn ( DBusConnection , & str , & str ) + ' static ,
29
29
{
30
- glib:: Closure :: new ( move |args| {
30
+ glib:: Closure :: new_local ( move |args| {
31
31
let conn = args[ 0 ] . get :: < DBusConnection > ( ) . unwrap ( ) ;
32
32
let name = args[ 1 ] . get :: < & str > ( ) . unwrap ( ) ;
33
33
let name_owner = args[ 2 ] . get :: < & str > ( ) . unwrap ( ) ;
38
38
39
39
fn vanished_closure < F > ( f : F ) -> glib:: Closure
40
40
where
41
- F : Fn ( DBusConnection , & str ) + Send + Sync + ' static ,
41
+ F : Fn ( DBusConnection , & str ) + ' static ,
42
42
{
43
- glib:: Closure :: new ( move |args| {
43
+ glib:: Closure :: new_local ( move |args| {
44
44
let conn = args[ 0 ] . get :: < DBusConnection > ( ) . unwrap ( ) ;
45
45
let name = args[ 1 ] . get :: < & str > ( ) . unwrap ( ) ;
46
46
f ( conn, name) ;
@@ -57,8 +57,8 @@ pub fn bus_own_name_on_connection<NameAcquired, NameLost>(
57
57
name_lost : NameLost ,
58
58
) -> OwnerId
59
59
where
60
- NameAcquired : Fn ( DBusConnection , & str ) + Send + Sync + ' static ,
61
- NameLost : Fn ( DBusConnection , & str ) + Send + Sync + ' static ,
60
+ NameAcquired : Fn ( DBusConnection , & str ) + ' static ,
61
+ NameLost : Fn ( DBusConnection , & str ) + ' static ,
62
62
{
63
63
unsafe {
64
64
let id = ffi:: g_bus_own_name_on_connection_with_closures (
@@ -82,9 +82,9 @@ pub fn bus_own_name<BusAcquired, NameAcquired, NameLost>(
82
82
name_lost : NameLost ,
83
83
) -> OwnerId
84
84
where
85
- BusAcquired : Fn ( DBusConnection , & str ) + Send + Sync + ' static ,
86
- NameAcquired : Fn ( DBusConnection , & str ) + Send + Sync + ' static ,
87
- NameLost : Fn ( Option < DBusConnection > , & str ) + Send + Sync + ' static ,
85
+ BusAcquired : Fn ( DBusConnection , & str ) + ' static ,
86
+ NameAcquired : Fn ( DBusConnection , & str ) + ' static ,
87
+ NameLost : Fn ( Option < DBusConnection > , & str ) + ' static ,
88
88
{
89
89
unsafe {
90
90
let id = ffi:: g_bus_own_name_with_closures (
93
93
flags. into_glib ( ) ,
94
94
own_closure ( bus_acquired) . to_glib_none ( ) . 0 ,
95
95
own_closure ( name_acquired) . to_glib_none ( ) . 0 ,
96
- glib:: Closure :: new ( move |args| {
96
+ glib:: Closure :: new_local ( move |args| {
97
97
let conn = args[ 0 ] . get :: < Option < DBusConnection > > ( ) . unwrap ( ) ;
98
98
let name = args[ 1 ] . get :: < & str > ( ) . unwrap ( ) ;
99
99
name_lost ( conn, name) ;
@@ -122,8 +122,8 @@ pub fn bus_watch_name_on_connection<NameAppeared, NameVanished>(
122
122
name_vanished : NameVanished ,
123
123
) -> WatcherId
124
124
where
125
- NameAppeared : Fn ( DBusConnection , & str , & str ) + Send + Sync + ' static ,
126
- NameVanished : Fn ( DBusConnection , & str ) + Send + Sync + ' static ,
125
+ NameAppeared : Fn ( DBusConnection , & str , & str ) + ' static ,
126
+ NameVanished : Fn ( DBusConnection , & str ) + ' static ,
127
127
{
128
128
unsafe {
129
129
let id = ffi:: g_bus_watch_name_on_connection_with_closures (
@@ -146,8 +146,8 @@ pub fn bus_watch_name<NameAppeared, NameVanished>(
146
146
name_vanished : NameVanished ,
147
147
) -> WatcherId
148
148
where
149
- NameAppeared : Fn ( DBusConnection , & str , & str ) + Send + Sync + ' static ,
150
- NameVanished : Fn ( DBusConnection , & str ) + Send + Sync + ' static ,
149
+ NameAppeared : Fn ( DBusConnection , & str , & str ) + ' static ,
150
+ NameVanished : Fn ( DBusConnection , & str ) + ' static ,
151
151
{
152
152
unsafe {
153
153
let id = ffi:: g_bus_watch_name_with_closures (
0 commit comments