Skip to content

Commit c915816

Browse files
committed
fix: Clone veth_host for debug message
veth_host is moved into async block, so clone it first for the debug statement that runs after the async block completes.
1 parent 451449a commit c915816

File tree

1 file changed

+4
-1
lines changed

1 file changed

+4
-1
lines changed

src/jail/linux/mod.rs

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -265,6 +265,9 @@ impl LinuxJail {
265265
.parse()
266266
.context("Failed to parse prefix length")?;
267267

268+
// Clone for debug after move
269+
let veth_host_debug = veth_host.clone();
270+
268271
// Configure host side
269272
block_on(async move {
270273
let (connection, handle, _) = rtnetlink::new_connection()?;
@@ -289,7 +292,7 @@ impl LinuxJail {
289292
);
290293
}
291294

292-
debug!("Configured host side networking for {}", veth_host);
295+
debug!("Configured host side networking for {}", veth_host_debug);
293296
Ok(())
294297
}
295298

0 commit comments

Comments
 (0)