Skip to content

Commit

Permalink
Don't try to unwrap a non-Result/Option
Browse files Browse the repository at this point in the history
  • Loading branch information
gmarler committed Mar 23, 2024
1 parent 5e74a3b commit 71afe9f
Showing 1 changed file with 3 additions and 4 deletions.
7 changes: 3 additions & 4 deletions src/profiler.rs
Original file line number Diff line number Diff line change
Expand Up @@ -1230,10 +1230,9 @@ impl Profiler<'_> {
pub fn setup_perf_events(&mut self) {
let mut prog_fds = Vec::new();
for i in 0..num_cpus::get() {
let perf_fd = unsafe {
setup_perf_event(i.try_into().unwrap(), self.sample_freq.try_into().unwrap())
}
.expect("setup perf event");
let perf_fd =
unsafe { setup_perf_event(i.try_into().unwrap(), self.sample_freq as u64) }
.expect("setup perf event");
prog_fds.push(perf_fd);
}

Expand Down

0 comments on commit 71afe9f

Please sign in to comment.