summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMatthias Beyer <mail@beyermatthias.de>2018-02-06 23:29:22 +0100
committerGitHub <noreply@github.com>2018-02-06 23:29:22 +0100
commit864e457dce5ce66161d5904d11287297f75d6848 (patch)
tree6e2fe7eadacf8d1e0c3f790927bd6829ccee79d5
parentda74896248dae44f5e17c76dba328a756d53a0e0 (diff)
parent88b7b43d2cdf7d8c480d4c6099a1c3a264d56b1b (diff)
downloadimag-864e457dce5ce66161d5904d11287297f75d6848.zip
imag-864e457dce5ce66161d5904d11287297f75d6848.tar.gz
Merge pull request #1259 from matthiasbeyer/imag-log/no-leading-space
Do not put a leading space in the log
-rw-r--r--bin/domain/imag-log/src/main.rs7
1 files changed, 5 insertions, 2 deletions
diff --git a/bin/domain/imag-log/src/main.rs b/bin/domain/imag-log/src/main.rs
index b1e8e1c..088abec 100644
--- a/bin/domain/imag-log/src/main.rs
+++ b/bin/domain/imag-log/src/main.rs
@@ -188,8 +188,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
})