cmd/restic: Remove trailing "..." from progress messages

These were added after message since the last refactor of the progress
printing code. Also skips an allocation in the common case.
This commit is contained in:
greatroar 2022-05-31 18:41:46 +02:00
parent 74f7fe2b98
commit b7c990871f

View file

@ -58,7 +58,10 @@ func printProgress(status string, canUpdateStatus bool) {
if w < 3 {
status = termstatus.Truncate(status, w)
} else {
status = termstatus.Truncate(status, w-3) + "..."
trunc := termstatus.Truncate(status, w-3)
if len(trunc) < len(status) {
status = trunc + "..."
}
}
}