Skip to content

Commit

Permalink
style(profiling): fix some easy clippy lints (#2633)
Browse files Browse the repository at this point in the history
  • Loading branch information
realFlowControl authored Apr 19, 2024
1 parent 47832e1 commit 3a01a05
Show file tree
Hide file tree
Showing 3 changed files with 3 additions and 4 deletions.
2 changes: 1 addition & 1 deletion profiling/src/allocation.rs
Original file line number Diff line number Diff line change
Expand Up @@ -186,7 +186,7 @@ pub fn alloc_prof_rinit() {
let zend_mm_state = cell.get();

// Safety: `zend_mm_get_heap()` always returns a non-null pointer to a valid heap structure
let heap = unsafe { Some(zend::zend_mm_get_heap()).unwrap() };
let heap = unsafe { zend::zend_mm_get_heap() };

unsafe { ptr::addr_of_mut!((*zend_mm_state).heap).write(Some(heap)) };

Expand Down
1 change: 0 additions & 1 deletion profiling/src/logging.rs
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
use env_logger::Target;
pub use log::Level;
pub use log::LevelFilter;
use std::fs::File;
use std::os::unix::io::FromRawFd;
Expand Down
4 changes: 2 additions & 2 deletions profiling/src/profiling/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -771,10 +771,10 @@ impl Profiler {
value: LabelValue::Str(exception.clone().into()),
});

if message.is_some() {
if let Some(message) = message {
labels.push(Label {
key: "exception message",
value: LabelValue::Str(message.unwrap().into()),
value: LabelValue::Str(message.into()),
});
}

Expand Down

0 comments on commit 3a01a05

Please sign in to comment.