File tree Expand file tree Collapse file tree 3 files changed +9
-9
lines changed
Expand file tree Collapse file tree 3 files changed +9
-9
lines changed Original file line number Diff line number Diff line change @@ -167,6 +167,6 @@ pub fn module(module: ModuleBuilder) -> ModuleBuilder {
167167#[ php_extern]
168168extern "C" {
169169 fn test_func < ' a > ( ) -> Callable < ' a > ;
170- fn strpos2 < ' a > ( haystack : & str , needle : & str , offset : Option < i32 > ) -> Zval ;
171- pub fn strpos < ' a > ( haystack : & str , needle : & str , offset : Option < i32 > ) -> Zval ;
170+ fn strpos2 ( haystack : & str , needle : & str , offset : Option < i32 > ) -> Zval ;
171+ pub fn strpos ( haystack : & str , needle : & str , offset : Option < i32 > ) -> Zval ;
172172}
Original file line number Diff line number Diff line change @@ -71,13 +71,7 @@ impl<'a> Arg<'a> {
7171 /// This will be None until the ArgParser is used to parse
7272 /// the arguments.
7373 pub fn val < T : TryFrom < & ' a Zval > > ( & self ) -> Option < T > {
74- match self . zval {
75- Some ( zval) => match zval. try_into ( ) {
76- Ok ( val) => Some ( val) ,
77- Err ( _) => None ,
78- } ,
79- None => None ,
80- }
74+ self . zval . and_then ( |zv| zv. try_into ( ) . ok ( ) )
8175 }
8276
8377 /// Attempts to return a reference to the arguments internal Zval.
Original file line number Diff line number Diff line change @@ -78,3 +78,9 @@ impl<T: Pack> From<Binary<T>> for Vec<T> {
7878 value. 0
7979 }
8080}
81+
82+ impl < T : Pack > From < Vec < T > > for Binary < T > {
83+ fn from ( value : Vec < T > ) -> Self {
84+ Self :: new ( value)
85+ }
86+ }
You can’t perform that action at this time.
0 commit comments