Skip to content

Commit e0ae481

Browse files
committed
Cleanup
1 parent 33f9d6e commit e0ae481

File tree

2 files changed

+10
-3
lines changed

2 files changed

+10
-3
lines changed

src/zend/fibers.rs

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -50,8 +50,8 @@ impl EventLoop {
5050
let (notify_receiver, notify_sender) =
5151
sys_pipe().map_err(|err| format!("Could not create pipe: {}", err))?;
5252

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")?;
5555

5656
Ok(Self {
5757
fibers: ZendHashTable::new(),
@@ -95,7 +95,6 @@ impl EventLoop {
9595
let mut suspension = call_user_func!(c.get_current_suspension).unwrap();
9696
c.suspend.try_call_obj(&mut suspension, vec![])
9797
}).unwrap();
98-
()
9998
}
10099

101100
pub fn get_sender(&self) -> Sender<u64> {

src/zend/function.rs

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -68,6 +68,14 @@ impl Function {
6868
}
6969
}
7070

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+
7179
/// Attempts to call the callable with a list of arguments to pass to the
7280
/// function.
7381
///

0 commit comments

Comments
 (0)