We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 85836da commit a4e3485Copy full SHA for a4e3485
src/zend/function.rs
@@ -77,11 +77,17 @@ impl Function {
77
}
78
79
pub fn from_function(name: &str) -> Self {
80
- Self::try_from_function(name).unwrap()
+ match Self::try_from_function(name) {
81
+ Some(v) => v,
82
+ None => panic!("Expected function `{}` to exist!", name),
83
+ }
84
85
86
pub fn from_method(class: &str, name: &str) -> Self {
- Self::try_from_method(class, name).unwrap()
87
+ match Self::try_from_method(class, name) {
88
89
+ None => panic!("Expected method `{}::{}` to exist!", class, name),
90
91
92
93
/// Attempts to call the callable with a list of arguments to pass to the
0 commit comments