Merge pull request #1259 from matthiasbeyer/imag-log/no-leading-space

Do not put a leading space in the log
This commit is contained in:
Matthias Beyer 2018-02-06 23:29:22 +01:00 committed by GitHub
commit 864e457dce
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -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
})