diff --git a/src/python_bindings/v3_7_0.rs b/src/python_bindings/v3_7_0.rs index e191cddf..7cd13800 100644 --- a/src/python_bindings/v3_7_0.rs +++ b/src/python_bindings/v3_7_0.rs @@ -123,7 +123,7 @@ impl ::std::fmt::Debug for __IncompleteArrayField { impl ::std::clone::Clone for __IncompleteArrayField { #[inline] fn clone(&self) -> Self { - Self::new() + *self } } impl ::std::marker::Copy for __IncompleteArrayField {} diff --git a/src/python_bindings/v3_8_0.rs b/src/python_bindings/v3_8_0.rs index 6377e86d..bced6874 100644 --- a/src/python_bindings/v3_8_0.rs +++ b/src/python_bindings/v3_8_0.rs @@ -123,7 +123,7 @@ impl ::std::fmt::Debug for __IncompleteArrayField { impl ::std::clone::Clone for __IncompleteArrayField { #[inline] fn clone(&self) -> Self { - Self::new() + *self } } impl ::std::marker::Copy for __IncompleteArrayField {} diff --git a/src/sampler.rs b/src/sampler.rs index d9831abc..db010e6c 100644 --- a/src/sampler.rs +++ b/src/sampler.rs @@ -56,7 +56,7 @@ impl Sampler { spy } Err(e) => { - if initialized_tx.send(Err(e)).is_err() {} + initialized_tx.send(Err(e)).unwrap_err(); return; } }; @@ -308,7 +308,7 @@ impl PythonSpyThread { } Err(e) => { warn!("Failed to profile python from process {}: {}", pid, e); - if initialized_tx.send(Err(e)).is_err() {} + initialized_tx.send(Err(e)).unwrap_err(); return; } }; diff --git a/src/speedscope.rs b/src/speedscope.rs index 8d8a4023..faf57a0d 100644 --- a/src/speedscope.rs +++ b/src/speedscope.rs @@ -231,10 +231,7 @@ impl Stats { let key = (stack.pid as Pid, stack.thread_id as Tid); - self.samples - .entry(key) - .or_insert_with(std::vec::Vec::new) - .push(frame_indices); + self.samples.entry(key).or_default().push(frame_indices); let subprocesses = self.config.subprocesses; self.thread_name_map.entry(key).or_insert_with(|| { let thread_name = stack