From 88b7b43d2cdf7d8c480d4c6099a1c3a264d56b1b Mon Sep 17 00:00:00 2001 From: Matthias Beyer Date: Tue, 6 Feb 2018 20:54:11 +0100 Subject: [PATCH] Do not put a leading space in the log --- bin/domain/imag-log/src/main.rs | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/bin/domain/imag-log/src/main.rs b/bin/domain/imag-log/src/main.rs index 1cb7291b..877bded9 100644 --- a/bin/domain/imag-log/src/main.rs +++ b/bin/domain/imag-log/src/main.rs @@ -183,8 +183,11 @@ fn get_log_text(rt: &Runtime) -> String { rt.cli() .values_of("text") .unwrap() // safe by clap - .fold(String::with_capacity(500), |mut acc, e| { - acc.push_str(" "); + .enumerate() + .fold(String::with_capacity(500), |mut acc, (n, e)| { + if n != 0 { + acc.push_str(" "); + } acc.push_str(e); acc })