Skip to content

Commit

Permalink
clippy fixes
Browse files Browse the repository at this point in the history
  • Loading branch information
akhramov committed Jul 14, 2024
1 parent 5596f94 commit 40be901
Show file tree
Hide file tree
Showing 6 changed files with 6 additions and 6 deletions.
1 change: 1 addition & 0 deletions src/binary_parser.rs
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@ use anyhow::Error;
use goblin::Object;
use memmap::Mmap;

#[allow(dead_code)]
pub struct BinaryInfo {
pub filename: std::path::PathBuf,
pub symbols: HashMap<String, u64>,
Expand Down
2 changes: 1 addition & 1 deletion src/config.rs
Original file line number Diff line number Diff line change
Expand Up @@ -422,7 +422,7 @@ impl Config {
}

config.subprocesses = matches.occurrences_of("subprocesses") > 0;
config.command = subcommand.to_owned();
subcommand.clone_into(&mut config.command);

// options that can be shared between subcommands
config.pid = matches
Expand Down
2 changes: 1 addition & 1 deletion src/cython.rs
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ impl SourceMaps {
if let Some(map) = self.maps.get(&frame.filename) {
if let Some(map) = map {
if let Some((file, line)) = map.lookup(line) {
frame.filename = file.clone();
frame.filename.clone_from(file);
frame.line = *line as i32;
}
}
Expand Down
2 changes: 1 addition & 1 deletion src/python_process_info.rs
Original file line number Diff line number Diff line change
Expand Up @@ -613,7 +613,7 @@ pub trait ContainsAddr {

impl ContainsAddr for Vec<MapRange> {
#[cfg(windows)]
fn contains_addr(&self, addr: usize) -> bool {
fn contains_addr(&self, _addr: usize) -> bool {
// On windows, we can't just check if a pointer is valid by looking to see if it points
// to something in the virtual memory map. Brute-force it instead
true
Expand Down
3 changes: 1 addition & 2 deletions src/python_spy.rs
Original file line number Diff line number Diff line change
@@ -1,5 +1,3 @@
#[cfg(windows)]
use regex::RegexBuilder;
use std::collections::HashMap;
#[cfg(all(target_os = "linux", unwind))]
use std::collections::HashSet;
Expand All @@ -26,6 +24,7 @@ use crate::stack_trace::{get_gil_threadid, get_stack_trace, StackTrace};
use crate::version::Version;

/// Lets you retrieve stack traces of a running python program
#[allow(dead_code)]
pub struct PythonSpy {
pub pid: Pid,
pub process: Process,
Expand Down
2 changes: 1 addition & 1 deletion src/sampler.rs
Original file line number Diff line number Diff line change
Expand Up @@ -219,7 +219,7 @@ impl Sampler {
let process = process_info
.entry(pid)
.or_insert_with(|| get_process_info(pid, &spies).map(|p| Arc::new(*p)));
trace.process_info = process.clone();
trace.process_info.clone_from(process);
}

// Send the collected info back
Expand Down

0 comments on commit 40be901

Please sign in to comment.