Skip to content

Commit a4e3485

Browse files
committed
Update
1 parent 85836da commit a4e3485

File tree

1 file changed

+8
-2
lines changed

1 file changed

+8
-2
lines changed

src/zend/function.rs

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -77,11 +77,17 @@ impl Function {
7777
}
7878

7979
pub fn from_function(name: &str) -> Self {
80-
Self::try_from_function(name).unwrap()
80+
match Self::try_from_function(name) {
81+
Some(v) => v,
82+
None => panic!("Expected function `{}` to exist!", name),
83+
}
8184
}
8285

8386
pub fn from_method(class: &str, name: &str) -> Self {
84-
Self::try_from_method(class, name).unwrap()
87+
match Self::try_from_method(class, name) {
88+
Some(v) => v,
89+
None => panic!("Expected method `{}::{}` to exist!", class, name),
90+
}
8591
}
8692

8793
/// Attempts to call the callable with a list of arguments to pass to the

0 commit comments

Comments
 (0)