Skip to content

Commit

Permalink
Fix build
Browse files Browse the repository at this point in the history
  • Loading branch information
ShawnZhong committed Jan 13, 2023
1 parent 43c2eae commit b9f8bf1
Showing 1 changed file with 4 additions and 11 deletions.
15 changes: 4 additions & 11 deletions include/fmt/chrono.h
Original file line number Diff line number Diff line change
Expand Up @@ -677,16 +677,9 @@ enum class pad_type {
};

template <typename OutputIt>
auto write_padding(OutputIt out, int width, pad_type pad) {
switch (pad) {
case pad_type::zero:
case pad_type::unspecified:
return std::fill_n(out, width, '0');
case pad_type::space:
return std::fill_n(out, width, ' ');
case pad_type::none:
return out;
}
auto write_padding(OutputIt out, int width, pad_type pad) -> OutputIt {
if (pad == pad_type::none) return out;
return std::fill_n(out, width, pad == pad_type::zero ? '0' : ' ');
}

// Parses a put_time-like format string and invokes handler actions.
Expand Down Expand Up @@ -1978,7 +1971,7 @@ struct chrono_formatter {
precision);
if (negative) *out++ = '-';
if (buf.size() < 2 || buf[1] == '.') {
out = detail::write_padding(out, 1, pad);
out = detail::write_padding(out, 1, pad);
}
out = std::copy(buf.begin(), buf.end(), out);
} else {
Expand Down

0 comments on commit b9f8bf1

Please sign in to comment.