diff --git a/demo.cpp b/demo.cpp index e3684b9..7d7b6ca 100644 --- a/demo.cpp +++ b/demo.cpp @@ -41,10 +41,7 @@ int main(int /*argc*/, char** /*argv*/) { for (auto speed : {Speed::None, Speed::Overall, Speed::Last, Speed::Both}) { unsigned long long work{677}; - auto c = Counter(work) - .message("Decreasing") - .speed_unit("") - .speed(speed); + auto c = Counter(work).message("Decreasing").speed_unit("").speed(speed); c.show(); while (work > 0) { std::this_thread::sleep_for(13ms); diff --git a/meanwhile/meanwhile.h b/meanwhile/meanwhile.h index 54917ae..64c3935 100644 --- a/meanwhile/meanwhile.h +++ b/meanwhile/meanwhile.h @@ -347,7 +347,7 @@ class Speedometer { private: Progress& progress_; // Current amount of work done Speed speed_ = Speed::None; // Time interval to compute speed over - std::string speed_unit_; // unit (message) to display alongside speed + std::string speed_unit_; // unit (message) to display alongside speed using Clock = std::chrono::system_clock; using Time = std::chrono::time_point; @@ -539,8 +539,9 @@ class ProgressBar : public AsyncDisplay { ValueType progress_copy = progress_; // to avoid progress_ changing during computations below int on = int(ValueType(width_) * progress_copy / total_); - size_t partial = size_t(ValueType(partials_.size()) * ValueType(width_) * progress_copy / total_ - - ValueType(partials_.size()) * ValueType(on)); + size_t partial = size_t(ValueType(partials_.size()) * ValueType(width_) * + progress_copy / total_ - + ValueType(partials_.size()) * ValueType(on)); if (on >= int(width_)) { on = width_; partial = 0; diff --git a/test.cpp b/test.cpp index 2f24527..2dd3444 100644 --- a/test.cpp +++ b/test.cpp @@ -288,13 +288,13 @@ TEST_CASE("Composite bar-counter", "[composite]") { std::stringstream out; std::atomic sents{0}, toks{0}; - auto bar = ProgressBar(sents, out) - .total(505) - .message("Sents") - .style(Bars) - .interval(0.01) | - Counter(toks, out).message("Toks").speed_unit("tok/s").speed( - Speed::Last); + auto bar = + ProgressBar(sents, out) + .total(505) + .message("Sents") + .style(Bars) + .interval(0.01) | + Counter(toks, out).message("Toks").speed_unit("tok/s").speed(Speed::Last); bar.show(); for (int i = 0; i < 505; i++) { std::this_thread::sleep_for(0.13ms);