Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

style(profiling): fix some easy clippy lints #2633

Merged
merged 1 commit into from
Apr 19, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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
Loading