Skip to content

Commit f3000ad

Browse files
fix clippy warning
1 parent 90e4b73 commit f3000ad

File tree

1 file changed

+6
-9
lines changed

1 file changed

+6
-9
lines changed

profiling/src/allocation/allocation_ge84.rs

Lines changed: 6 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
use crate::allocation::{allocation_profiling_stats_should_collect, collect_allocation};
22
use crate::bindings as zend;
3-
use crate::{RefCellExt, PROFILER_NAME};
3+
use crate::PROFILER_NAME;
44
use core::{cell::Cell, ptr};
55
use lazy_static::lazy_static;
66
use libc::{c_char, c_int, c_void, size_t};
@@ -362,8 +362,7 @@ unsafe fn alloc_prof_prev_alloc(len: size_t) -> *mut c_void {
362362

363363
unsafe fn alloc_prof_orig_alloc(len: size_t) -> *mut c_void {
364364
let heap = zend::zend_mm_get_heap();
365-
let ptr: *mut c_void = zend::_zend_mm_alloc(heap, len);
366-
ptr
365+
zend::_zend_mm_alloc(heap, len)
367366
}
368367

369368
/// This function exists because when calling `zend_mm_set_custom_handlers()`,
@@ -418,20 +417,18 @@ unsafe fn alloc_prof_prev_realloc(prev_ptr: *mut c_void, len: size_t) -> *mut c_
418417

419418
unsafe fn alloc_prof_orig_realloc(prev_ptr: *mut c_void, len: size_t) -> *mut c_void {
420419
let heap = zend::zend_mm_get_heap();
421-
let ptr: *mut c_void = zend::_zend_mm_realloc(heap, prev_ptr, len);
422-
ptr
420+
zend::_zend_mm_realloc(heap, prev_ptr, len)
423421
}
424422

425423
unsafe extern "C" fn alloc_prof_gc() -> size_t {
426424
tls_zend_mm_state_get!(gc)()
427425
}
428426

429427
unsafe fn alloc_prof_prev_gc() -> size_t {
430-
let gc = tls_zend_mm_state_get!(prev_custom_mm_gc);
431-
if let Some(gc) = gc {
432-
return gc();
428+
match tls_zend_mm_state_get!(prev_custom_mm_gc) {
429+
Some(gc) => gc(),
430+
None => 0,
433431
}
434-
0
435432
}
436433

437434
unsafe fn alloc_prof_orig_gc() -> size_t {

0 commit comments

Comments
 (0)