Skip to content

Commit 955f7e5

Browse files
[autofix.ci] apply automated fixes (attempt 3/3)
1 parent 4fa97c5 commit 955f7e5

3 files changed

Lines changed: 9 additions & 10 deletions

File tree

mitmproxy-windows/redirector/src/main2.rs

Lines changed: 4 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -129,7 +129,7 @@ async fn main() -> Result<()> {
129129

130130
tokio::spawn(async move {
131131
if let Err(e) = handle_ipc(ipc_client, ipc_rx, event_tx).await {
132-
error!("Error handling IPC: {}", e);
132+
error!("Error handling IPC: {e}");
133133
std::process::exit(1);
134134
}
135135
});
@@ -148,7 +148,7 @@ async fn main() -> Result<()> {
148148
let packet = match InternetPacket::try_from(data) {
149149
Ok(p) => p,
150150
Err(e) => {
151-
debug!("Error parsing packet: {:?}", e);
151+
debug!("Error parsing packet: {e:?}");
152152
continue;
153153
}
154154
};
@@ -165,8 +165,7 @@ async fn main() -> Result<()> {
165165
packet.src_ip().is_loopback() && packet.dst_ip().is_loopback();
166166
if is_multicast || is_loopback_only {
167167
debug!(
168-
"skipping multicast={} loopback={}",
169-
is_multicast, is_loopback_only
168+
"skipping multicast={is_multicast} loopback={is_loopback_only}"
170169
);
171170
inject_handle.send(&WinDivertPacket {
172171
address,
@@ -333,7 +332,7 @@ async fn main() -> Result<()> {
333332
let packet = match InternetPacket::try_from(buf.to_vec()) {
334333
Ok(p) => p,
335334
Err(e) => {
336-
info!("Error parsing packet: {:?}", e);
335+
info!("Error parsing packet: {e:?}");
337336
continue;
338337
}
339338
};

src/packet_sources/windows.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -81,15 +81,15 @@ impl PacketSourceConf for WindowsConf {
8181
if cfg!(debug_assertions) {
8282
if result.0 as u32 <= 32 {
8383
let err = windows::core::Error::from_win32();
84-
log::warn!("Failed to start child process: {}", err);
84+
log::warn!("Failed to start child process: {err}");
8585
}
8686
} else if result.0 as u32 == SE_ERR_ACCESSDENIED {
8787
return Err(anyhow!(
8888
"Failed to start the interception process as administrator."
8989
));
9090
} else if result.0 as u32 <= 32 {
9191
let err = windows::core::Error::from_win32();
92-
return Err(anyhow!("Failed to start the executable: {}", err));
92+
return Err(anyhow!("Failed to start the executable: {err}"));
9393
}
9494

9595
let (conf_tx, conf_rx) = unbounded_channel();

src/processes/windows_list.rs

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -245,7 +245,7 @@ pub fn visible_windows() -> Result<HashSet<PID>> {
245245
&mut cloaked as *mut BOOL as *mut _,
246246
size_of::<BOOL>() as u32,
247247
) {
248-
log::debug!("DwmGetWindowAttribute failed: {:#}", e);
248+
log::debug!("DwmGetWindowAttribute failed: {e:#}");
249249
false
250250
} else {
251251
cloaked.as_bool()
@@ -298,9 +298,9 @@ mod tests {
298298
for pid in pids {
299299
let procname = super::get_process_name(pid)
300300
.map(|p| p.display().to_string())
301-
.unwrap_or_else(|e| format!("<{:?}>", e));
301+
.unwrap_or_else(|e| format!("<{e:?}>"));
302302

303-
println!("{: >6} {}", pid, procname);
303+
println!("{pid: >6} {procname}");
304304
}
305305
}
306306

0 commit comments

Comments
 (0)