diff --git a/src/binary_parser.rs b/src/binary_parser.rs index 79d01835..dd619af1 100644 --- a/src/binary_parser.rs +++ b/src/binary_parser.rs @@ -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, diff --git a/src/config.rs b/src/config.rs index d8c936f9..cd719eac 100644 --- a/src/config.rs +++ b/src/config.rs @@ -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 diff --git a/src/cython.rs b/src/cython.rs index 3497f614..5b3e0c83 100644 --- a/src/cython.rs +++ b/src/cython.rs @@ -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; } } diff --git a/src/python_process_info.rs b/src/python_process_info.rs index 10adaf80..a5b3d0e2 100644 --- a/src/python_process_info.rs +++ b/src/python_process_info.rs @@ -613,7 +613,7 @@ pub trait ContainsAddr { impl ContainsAddr for Vec { #[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 diff --git a/src/python_spy.rs b/src/python_spy.rs index f5e36d68..6db6bf9c 100644 --- a/src/python_spy.rs +++ b/src/python_spy.rs @@ -1,5 +1,3 @@ -#[cfg(windows)] -use regex::RegexBuilder; use std::collections::HashMap; #[cfg(all(target_os = "linux", unwind))] use std::collections::HashSet; @@ -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, diff --git a/src/sampler.rs b/src/sampler.rs index 10f0cdfa..5cc99d84 100644 --- a/src/sampler.rs +++ b/src/sampler.rs @@ -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