Run clang-format on chrono.h

This commit is contained in:
zeffy 2020-01-23 16:58:40 -08:00
parent 0470ec1ac9
commit 3aae6d2350

View File

@ -8,14 +8,14 @@
#ifndef FMT_CHRONO_H_ #ifndef FMT_CHRONO_H_
#define FMT_CHRONO_H_ #define FMT_CHRONO_H_
#include "format.h"
#include "locale.h"
#include <chrono> #include <chrono>
#include <ctime> #include <ctime>
#include <locale> #include <locale>
#include <sstream> #include <sstream>
#include "format.h"
#include "locale.h"
FMT_BEGIN_NAMESPACE FMT_BEGIN_NAMESPACE
// Enable safe chrono durations, unless explicitly disabled. // Enable safe chrono durations, unless explicitly disabled.
@ -440,7 +440,9 @@ template <typename Char> struct formatter<std::tm, Char> {
}; };
namespace internal { namespace internal {
template <typename Period> FMT_CONSTEXPR const char* get_units() { return nullptr; } template <typename Period> FMT_CONSTEXPR const char* get_units() {
return nullptr;
}
template <> FMT_CONSTEXPR const char* get_units<std::atto>() { return "as"; } template <> FMT_CONSTEXPR const char* get_units<std::atto>() { return "as"; }
template <> FMT_CONSTEXPR const char* get_units<std::femto>() { return "fs"; } template <> FMT_CONSTEXPR const char* get_units<std::femto>() { return "fs"; }
template <> FMT_CONSTEXPR const char* get_units<std::pico>() { return "ps"; } template <> FMT_CONSTEXPR const char* get_units<std::pico>() { return "ps"; }
@ -458,8 +460,12 @@ template <> FMT_CONSTEXPR const char* get_units<std::giga>() { return "Gs"; }
template <> FMT_CONSTEXPR const char* get_units<std::tera>() { return "Ts"; } template <> FMT_CONSTEXPR const char* get_units<std::tera>() { return "Ts"; }
template <> FMT_CONSTEXPR const char* get_units<std::peta>() { return "Ps"; } template <> FMT_CONSTEXPR const char* get_units<std::peta>() { return "Ps"; }
template <> FMT_CONSTEXPR const char* get_units<std::exa>() { return "Es"; } template <> FMT_CONSTEXPR const char* get_units<std::exa>() { return "Es"; }
template <> FMT_CONSTEXPR const char* get_units<std::ratio<60>>() { return "m"; } template <> FMT_CONSTEXPR const char* get_units<std::ratio<60>>() {
template <> FMT_CONSTEXPR const char* get_units<std::ratio<3600>>() { return "h"; } return "m";
}
template <> FMT_CONSTEXPR const char* get_units<std::ratio<3600>>() {
return "h";
}
enum class numeric_system { enum class numeric_system {
standard, standard,
@ -759,7 +765,8 @@ OutputIt format_duration_value(OutputIt out, Rep val, int precision) {
if (precision >= 0) return format_to(out, pr_f, val, precision); if (precision >= 0) return format_to(out, pr_f, val, precision);
const Char fp_f[]{'{', ':', 'g', '}', 0}; const Char fp_f[]{'{', ':', 'g', '}', 0};
const Char format[]{'{', '}', 0}; const Char format[]{'{', '}', 0};
return format_to(out, std::is_floating_point<Rep>::value ? fp_f : format, val); return format_to(out, std::is_floating_point<Rep>::value ? fp_f : format,
val);
} }
template <typename Char, typename Period, typename OutputIt> template <typename Char, typename Period, typename OutputIt>
@ -992,7 +999,9 @@ struct chrono_formatter {
out = format_duration_value<char_type>(out, val, precision); out = format_duration_value<char_type>(out, val, precision);
} }
void on_duration_unit() { out = format_duration_unit<char_type, Period>(out); } void on_duration_unit() {
out = format_duration_unit<char_type, Period>(out);
}
}; };
} // namespace internal } // namespace internal