File tree Expand file tree Collapse file tree 5 files changed +9
-8
lines changed Expand file tree Collapse file tree 5 files changed +9
-8
lines changed Original file line number Diff line number Diff line change @@ -32,7 +32,7 @@ impl<T> Deref for Vec<T> {
32
32
33
33
impl < T > Drop for Vec < T > {
34
34
fn drop ( & mut self ) {
35
- unsafe { Box :: from_raw ( std:: ptr:: slice_from_raw_parts_mut ( self . ptr , self . len ) ) } ;
35
+ unsafe { let _ = Box :: from_raw ( std:: ptr:: slice_from_raw_parts_mut ( self . ptr , self . len ) ) ; } ;
36
36
}
37
37
}
38
38
Original file line number Diff line number Diff line change @@ -52,7 +52,7 @@ impl ToStub for Module {
52
52
// Inserts a value into the entries hashmap. Takes a key and an entry, creating
53
53
// the internal vector if it doesn't already exist.
54
54
let mut insert = |ns, entry| {
55
- let bucket = entries. entry ( ns) . or_insert_with ( StdVec :: new ) ;
55
+ let bucket = entries. entry ( ns) . or_default ( ) ;
56
56
bucket. push ( entry) ;
57
57
} ;
58
58
Original file line number Diff line number Diff line change @@ -768,7 +768,7 @@ impl<'a> FromZval<'a> for &'a ZendHashTable {
768
768
}
769
769
770
770
///////////////////////////////////////////
771
- //// HashMap
771
+ /// HashMap
772
772
///////////////////////////////////////////
773
773
774
774
impl < ' a , V > TryFrom < & ' a ZendHashTable > for HashMap < String , V >
@@ -837,7 +837,7 @@ where
837
837
}
838
838
839
839
///////////////////////////////////////////
840
- //// Vec
840
+ /// Vec
841
841
///////////////////////////////////////////
842
842
843
843
impl < ' a , T > TryFrom < & ' a ZendHashTable > for Vec < T >
Original file line number Diff line number Diff line change @@ -34,6 +34,7 @@ impl ClassEntry {
34
34
/// # Panics
35
35
///
36
36
/// Panics when allocating memory for the new object fails.
37
+ #[ allow( clippy:: new_ret_no_self) ]
37
38
pub fn new ( & self ) -> ZBox < ZendObject > {
38
39
ZendObject :: new ( self )
39
40
}
Original file line number Diff line number Diff line change @@ -56,11 +56,11 @@ impl Function {
56
56
if res. is_null ( ) {
57
57
return None ;
58
58
}
59
- return Some ( * res) ;
59
+ Some ( * res)
60
60
}
61
61
}
62
62
pub fn try_from_method ( class : & str , name : & str ) -> Option < Self > {
63
- return match ClassEntry :: try_find ( class) {
63
+ match ClassEntry :: try_find ( class) {
64
64
None => None ,
65
65
Some ( ce) => unsafe {
66
66
let res = zend_hash_str_find_ptr_lc (
@@ -71,9 +71,9 @@ impl Function {
71
71
if res. is_null ( ) {
72
72
return None ;
73
73
}
74
- return Some ( * res) ;
74
+ Some ( * res)
75
75
} ,
76
- } ;
76
+ }
77
77
}
78
78
79
79
pub fn from_function ( name : & str ) -> Self {
You can’t perform that action at this time.
0 commit comments