mirror of
https://github.com/danog/ext-php-rs.git
synced 2024-11-29 20:29:01 +01:00
Fix
This commit is contained in:
parent
e820b2458a
commit
85836dad04
@ -32,7 +32,7 @@ impl<T> Deref for Vec<T> {
|
||||
|
||||
impl<T> Drop for Vec<T> {
|
||||
fn drop(&mut self) {
|
||||
unsafe { Box::from_raw(std::ptr::slice_from_raw_parts_mut(self.ptr, self.len)) };
|
||||
unsafe { let _ = Box::from_raw(std::ptr::slice_from_raw_parts_mut(self.ptr, self.len)); };
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -52,7 +52,7 @@ impl ToStub for Module {
|
||||
// Inserts a value into the entries hashmap. Takes a key and an entry, creating
|
||||
// the internal vector if it doesn't already exist.
|
||||
let mut insert = |ns, entry| {
|
||||
let bucket = entries.entry(ns).or_insert_with(StdVec::new);
|
||||
let bucket = entries.entry(ns).or_default();
|
||||
bucket.push(entry);
|
||||
};
|
||||
|
||||
|
@ -768,7 +768,7 @@ impl<'a> FromZval<'a> for &'a ZendHashTable {
|
||||
}
|
||||
|
||||
///////////////////////////////////////////
|
||||
//// HashMap
|
||||
/// HashMap
|
||||
///////////////////////////////////////////
|
||||
|
||||
impl<'a, V> TryFrom<&'a ZendHashTable> for HashMap<String, V>
|
||||
@ -837,7 +837,7 @@ where
|
||||
}
|
||||
|
||||
///////////////////////////////////////////
|
||||
//// Vec
|
||||
/// Vec
|
||||
///////////////////////////////////////////
|
||||
|
||||
impl<'a, T> TryFrom<&'a ZendHashTable> for Vec<T>
|
||||
|
@ -34,6 +34,7 @@ impl ClassEntry {
|
||||
/// # Panics
|
||||
///
|
||||
/// Panics when allocating memory for the new object fails.
|
||||
#[allow(clippy::new_ret_no_self)]
|
||||
pub fn new(&self) -> ZBox<ZendObject> {
|
||||
ZendObject::new(self)
|
||||
}
|
||||
|
@ -56,11 +56,11 @@ impl Function {
|
||||
if res.is_null() {
|
||||
return None;
|
||||
}
|
||||
return Some(*res);
|
||||
Some(*res)
|
||||
}
|
||||
}
|
||||
pub fn try_from_method(class: &str, name: &str) -> Option<Self> {
|
||||
return match ClassEntry::try_find(class) {
|
||||
match ClassEntry::try_find(class) {
|
||||
None => None,
|
||||
Some(ce) => unsafe {
|
||||
let res = zend_hash_str_find_ptr_lc(
|
||||
@ -71,9 +71,9 @@ impl Function {
|
||||
if res.is_null() {
|
||||
return None;
|
||||
}
|
||||
return Some(*res);
|
||||
Some(*res)
|
||||
},
|
||||
};
|
||||
}
|
||||
}
|
||||
|
||||
pub fn from_function(name: &str) -> Self {
|
||||
|
Loading…
Reference in New Issue
Block a user