Skip to content

Commit f50b135

Browse files
Erik Schillingstefano-garzarella
authored andcommitted
vhost-user-backend: simplify path concatination
Shortens code a bit and allows to keep the field non-mutable. Signed-off-by: Erik Schilling <[email protected]>
1 parent bc63db7 commit f50b135

File tree

1 file changed

+2
-4
lines changed
  • crates/vhost-user-backend/src

1 file changed

+2
-4
lines changed

crates/vhost-user-backend/src/lib.rs

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -211,8 +211,7 @@ mod tests {
211211

212212
let barrier = Arc::new(Barrier::new(2));
213213
let tmpdir = tempfile::tempdir().unwrap();
214-
let mut path = tmpdir.path().to_path_buf();
215-
path.push("socket");
214+
let path = tmpdir.path().join("socket");
216215

217216
let barrier2 = barrier.clone();
218217
let path1 = path.clone();
@@ -246,8 +245,7 @@ mod tests {
246245

247246
let barrier = Arc::new(Barrier::new(2));
248247
let tmpdir = tempfile::tempdir().unwrap();
249-
let mut path = tmpdir.path().to_path_buf();
250-
path.push("socket");
248+
let path = tmpdir.path().join("socket");
251249

252250
let barrier2 = barrier.clone();
253251
let path1 = path.clone();

0 commit comments

Comments
 (0)