From bcb15dcd755ce72bc600d48c00c036101e66cb91 Mon Sep 17 00:00:00 2001 From: Andrew Johnson Date: Wed, 23 May 2018 21:47:16 -0600 Subject: [PATCH] chapter 8 TR suggestions --- Chapter08/process_a.rs | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/Chapter08/process_a.rs b/Chapter08/process_a.rs index 5eefc5d..3d652cd 100644 --- a/Chapter08/process_a.rs +++ b/Chapter08/process_a.rs @@ -2,10 +2,9 @@ use std::process::Command; use std::env::current_exe; fn main() { - let mut path = current_exe() - .expect("could not find current executable"); - path.pop(); - path.push("process_b"); + let path = current_exe() + .expect("could not find current executable"); + let path = path.with_file_name("process_b"); let mut children = Vec::new(); for _ in 0..3 {