Skip to content

Commit

Permalink
style: incorporate code review feedback
Browse files Browse the repository at this point in the history
  • Loading branch information
morrisonlevi committed Dec 11, 2024
1 parent 77e55c5 commit 1be91fd
Showing 1 changed file with 4 additions and 8 deletions.
12 changes: 4 additions & 8 deletions profiling/src/timeline.rs
Original file line number Diff line number Diff line change
Expand Up @@ -204,15 +204,11 @@ unsafe extern "C" fn ddog_php_prof_zend_error_observer(
}

#[cfg(zend_error_observer_80)]
let filename = unsafe {
let cstr = core::ffi::CStr::from_ptr(file);
cstr.to_string_lossy().into_owned()
};
let filename_str = unsafe { core::ffi::CStr::from_ptr(file) };
#[cfg(not(zend_error_observer_80))]
let filename = unsafe {
let zstr = zai_str_from_zstr(file.as_mut());
zstr.into_string_lossy().into_owned()
};
let filename_str = unsafe { zai_str_from_zstr(file.as_mut()) };

let filename = filename_str.into_string_lossy().into_owned();

let now = SystemTime::now().duration_since(UNIX_EPOCH).unwrap();
if let Some(profiler) = Profiler::get() {
Expand Down

0 comments on commit 1be91fd

Please sign in to comment.