diff --git a/include/fmt/chrono.h b/include/fmt/chrono.h index 2e79d721..4a10af84 100644 --- a/include/fmt/chrono.h +++ b/include/fmt/chrono.h @@ -2020,7 +2020,6 @@ struct formatter, Char> { } void on_error(const char* msg) { FMT_THROW(format_error(msg)); } - FMT_CONSTEXPR void on_width(int width) { f.specs.width = width; } FMT_CONSTEXPR void on_precision(int _precision) { f.precision = _precision; } diff --git a/include/fmt/core.h b/include/fmt/core.h index 73a5f8e3..1e7f4f24 100644 --- a/include/fmt/core.h +++ b/include/fmt/core.h @@ -2241,7 +2241,6 @@ template class specs_setter { specs_.fill[0] = Char('0'); } - FMT_CONSTEXPR void on_width(int width) { specs_.width = width; } FMT_CONSTEXPR void on_precision(int precision) { specs_.precision = precision; } @@ -2264,7 +2263,7 @@ class dynamic_specs_handler FMT_CONSTEXPR auto parse_context() -> ParseContext& { return context_; } - FMT_CONSTEXPR void on_dynamic_width(const dynamic_spec& width) { + FMT_CONSTEXPR void on_width(const dynamic_spec& width) { switch (width.kind) { case dynamic_spec_kind::none: break; @@ -2666,7 +2665,7 @@ FMT_CONSTEXPR FMT_INLINE auto parse_format_specs(const Char* begin, } auto width_result = parse_width(begin, end, handler.parse_context()); - handler.on_dynamic_width(width_result.width); + handler.on_width(width_result.width); begin = width_result.end; if (begin == end) return begin; diff --git a/include/fmt/format.h b/include/fmt/format.h index 63766cd7..534ad3d8 100644 --- a/include/fmt/format.h +++ b/include/fmt/format.h @@ -3627,7 +3627,7 @@ template class specs_handler : public specs_setter { return parse_context_; } - FMT_CONSTEXPR void on_dynamic_width(const dynamic_spec& width) { + FMT_CONSTEXPR void on_width(const dynamic_spec& width) { auto arg = format_arg(); switch (width.kind) { case dynamic_spec_kind::none: diff --git a/test/core-test.cc b/test/core-test.cc index e070432a..55bd238b 100644 --- a/test/core-test.cc +++ b/test/core-test.cc @@ -553,8 +553,7 @@ struct test_format_specs_handler { constexpr void on_zero() { res = zero; } constexpr void on_localized() { res = loc; } - constexpr void on_width(int w) { width = w; } - constexpr void on_dynamic_width(const fmt::detail::dynamic_spec& spec) { + constexpr void on_width(const fmt::detail::dynamic_spec& spec) { switch (spec.kind) { case fmt::detail::dynamic_spec_kind::none: break;