File tree Expand file tree Collapse file tree 2 files changed +10
-3
lines changed Expand file tree Collapse file tree 2 files changed +10
-3
lines changed Original file line number Diff line number Diff line change @@ -50,8 +50,8 @@ impl EventLoop {
50
50
let ( notify_receiver, notify_sender) =
51
51
sys_pipe ( ) . map_err ( |err| format ! ( "Could not create pipe: {}" , err) ) ?;
52
52
53
- call_user_func ! ( Function :: try_from_function ( "class_exists" ) . unwrap ( ) , "\\ Revolt\\ EventLoop" ) ?;
54
- call_user_func ! ( Function :: try_from_function ( "interface_exists" ) . unwrap ( ) , "\\ Revolt\\ EventLoop\\ Suspension" ) ?;
53
+ call_user_func ! ( Function :: from_function ( "class_exists" ) , "\\ Revolt\\ EventLoop" ) ?;
54
+ call_user_func ! ( Function :: from_function ( "interface_exists" ) , "\\ Revolt\\ EventLoop\\ Suspension" ) ?;
55
55
56
56
Ok ( Self {
57
57
fibers : ZendHashTable :: new ( ) ,
@@ -95,7 +95,6 @@ impl EventLoop {
95
95
let mut suspension = call_user_func ! ( c. get_current_suspension) . unwrap ( ) ;
96
96
c. suspend . try_call_obj ( & mut suspension, vec ! [ ] )
97
97
} ) . unwrap ( ) ;
98
- ( )
99
98
}
100
99
101
100
pub fn get_sender ( & self ) -> Sender < u64 > {
Original file line number Diff line number Diff line change @@ -68,6 +68,14 @@ impl Function {
68
68
}
69
69
}
70
70
71
+ pub fn from_function ( name : & str ) -> Self {
72
+ Self :: try_from_function ( name) . unwrap ( )
73
+ }
74
+
75
+ pub fn from_method ( class : & str , name : & str ) -> Self {
76
+ Self :: try_from_method ( class, name) . unwrap ( )
77
+ }
78
+
71
79
/// Attempts to call the callable with a list of arguments to pass to the
72
80
/// function.
73
81
///
You can’t perform that action at this time.
0 commit comments