From a5353207c7c08c5ea81c8c358241b6a61173e93c Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Thu, 10 Mar 2022 12:10:45 +0000 Subject: Bump github.com/vbauerster/mpb/v7 from 7.3.2 to 7.4.1 Bumps [github.com/vbauerster/mpb/v7](https://github.com/vbauerster/mpb) from 7.3.2 to 7.4.1. - [Release notes](https://github.com/vbauerster/mpb/releases) - [Commits](https://github.com/vbauerster/mpb/compare/v7.3.2...v7.4.1) --- updated-dependencies: - dependency-name: github.com/vbauerster/mpb/v7 dependency-type: direct:production update-type: version-update:semver-minor ... Signed-off-by: dependabot[bot] --- .../github.com/vbauerster/mpb/v7/bar_filler_bar.go | 25 ++++++++++------------ 1 file changed, 11 insertions(+), 14 deletions(-) (limited to 'vendor/github.com/vbauerster/mpb/v7/bar_filler_bar.go') diff --git a/vendor/github.com/vbauerster/mpb/v7/bar_filler_bar.go b/vendor/github.com/vbauerster/mpb/v7/bar_filler_bar.go index 54b7bfd6f..d8bf90a4a 100644 --- a/vendor/github.com/vbauerster/mpb/v7/bar_filler_bar.go +++ b/vendor/github.com/vbauerster/mpb/v7/bar_filler_bar.go @@ -157,9 +157,8 @@ func (s *bFiller) Fill(w io.Writer, width int, stat decor.Statistics) { return } - ow := optimisticWriter(w) - ow(s.components[iLbound].bytes) - defer ow(s.components[iRbound].bytes) + mustWrite(w, s.components[iLbound].bytes) + defer mustWrite(w, s.components[iRbound].bytes) if width == 0 { return @@ -231,26 +230,24 @@ func (s *bFiller) Fill(w io.Writer, width int, stat decor.Statistics) { } if s.rev { - flush(ow, padding, filling) + flush(w, padding, filling) } else { - flush(ow, filling, padding) + flush(w, filling, padding) } } -func flush(ow func([]byte), filling, padding [][]byte) { +func flush(w io.Writer, filling, padding [][]byte) { for i := len(filling) - 1; i >= 0; i-- { - ow(filling[i]) + mustWrite(w, filling[i]) } for i := 0; i < len(padding); i++ { - ow(padding[i]) + mustWrite(w, padding[i]) } } -func optimisticWriter(w io.Writer) func([]byte) { - return func(p []byte) { - _, err := w.Write(p) - if err != nil { - panic(err) - } +func mustWrite(w io.Writer, p []byte) { + _, err := w.Write(p) + if err != nil { + panic(err) } } -- cgit v1.2.3-54-g00ecf