Skip to content

Commit

Permalink
fix lint errors (#623)
Browse files Browse the repository at this point in the history
* Update dependencies to pull in latest remoteprocess etc

* fix clippy/cargo-check warnings

The pre-commit was failing with the latest version of rust. Fix the errors
shown by newer clippy/cargo-check
  • Loading branch information
benfred authored Oct 23, 2023
1 parent 492b41c commit 1def303
Show file tree
Hide file tree
Showing 4 changed files with 5 additions and 8 deletions.
2 changes: 1 addition & 1 deletion src/python_bindings/v3_7_0.rs
Original file line number Diff line number Diff line change
Expand Up @@ -123,7 +123,7 @@ impl<T> ::std::fmt::Debug for __IncompleteArrayField<T> {
impl<T> ::std::clone::Clone for __IncompleteArrayField<T> {
#[inline]
fn clone(&self) -> Self {
Self::new()
*self
}
}
impl<T> ::std::marker::Copy for __IncompleteArrayField<T> {}
Expand Down
2 changes: 1 addition & 1 deletion src/python_bindings/v3_8_0.rs
Original file line number Diff line number Diff line change
Expand Up @@ -123,7 +123,7 @@ impl<T> ::std::fmt::Debug for __IncompleteArrayField<T> {
impl<T> ::std::clone::Clone for __IncompleteArrayField<T> {
#[inline]
fn clone(&self) -> Self {
Self::new()
*self
}
}
impl<T> ::std::marker::Copy for __IncompleteArrayField<T> {}
Expand Down
4 changes: 2 additions & 2 deletions src/sampler.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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;
}
};
Expand Down Expand Up @@ -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;
}
};
Expand Down
5 changes: 1 addition & 4 deletions src/speedscope.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down

0 comments on commit 1def303

Please sign in to comment.