Skip to content

Commit 1ef3471

Browse files
committed
Linting
1 parent 3d33de1 commit 1ef3471

File tree

1 file changed

+10
-11
lines changed

1 file changed

+10
-11
lines changed

src/lib.rs

Lines changed: 10 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
use log::{error, info, debug};
1+
use log::{debug, error, info};
22

33
use memflow::cglue;
44
use memflow::connector::cpu_state::*;
@@ -36,22 +36,21 @@ impl<P: MemoryView + Process> QemuProcfs<P> {
3636
let mut proc = None;
3737

3838
let callback = &mut |info: ProcessInfo| {
39-
4039
let matches = qemu_binary_name
4140
.as_ref()
4241
.map(|nm| &*info.name == nm)
4342
.unwrap_or_else(|| is_qemu(&info));
4443
if proc.is_none() && matches {
45-
debug!("Found QEMU process: {:#?}", info);
4644
proc = Some(info);
4745
}
48-
46+
4947
proc.is_none()
50-
5148
};
5249

5350
os.process_info_list_callback(callback.into())?;
5451

52+
debug!("reading qemu process: {:#?}", proc);
53+
5554
Self::with_process(
5655
os,
5756
proc.ok_or_else(|| {
@@ -80,7 +79,6 @@ impl<P: MemoryView + Process> QemuProcfs<P> {
8079
&& qemu_arg_opt(info.command_line.split_whitespace(), "-name", "guest").as_deref()
8180
== Some(name)
8281
{
83-
debug!("Found QEMU process with guest name '{}': {:#?}", name, info);
8482
proc = Some(info);
8583
}
8684

@@ -89,6 +87,8 @@ impl<P: MemoryView + Process> QemuProcfs<P> {
8987

9088
os.process_info_list_callback(callback.into())?;
9189

90+
debug!("reading qemu process: {:#?}", proc);
91+
9292
Self::with_process(
9393
os,
9494
proc.ok_or_else(||
@@ -216,7 +216,9 @@ fn validator() -> ArgsValidator {
216216
ArgsValidator::new()
217217
.arg(ArgDescriptor::new("map_base").description("override of VM memory base"))
218218
.arg(ArgDescriptor::new("map_size").description("override of VM memory size"))
219-
.arg(ArgDescriptor::new("qemu_binary_name").description("override default QEMU binary name"))
219+
.arg(
220+
ArgDescriptor::new("qemu_binary_name").description("override default QEMU binary name"),
221+
)
220222
}
221223

222224
/// Creates a new Qemu Procfs instance.
@@ -277,11 +279,8 @@ pub fn create_connector_with_os<O: Os>(
277279
.and_then(|size| umem::from_str_radix(size, 16).ok()),
278280
)
279281
.map(|(start, size)| CTup2(Address::from(start), size));
280-
281-
let qemu_binary_name_override = args
282-
.get("qemu_binary_name")
283-
.map(|s| s.to_string());
284282

283+
let qemu_binary_name_override = args.get("qemu_binary_name").map(|s| s.to_string());
285284

286285
if let Some(name) = name.or_else(|| args.get("name")) {
287286
if let Ok(pid) = Pid::from_str_radix(name, 10) {

0 commit comments

Comments
 (0)