mirror of
https://github.com/fmtlib/fmt.git
synced 2025-09-25 06:00:55 +02:00
Apply clang-tidy
This commit is contained in:
@@ -64,7 +64,7 @@ TEST(args_test, custom_format) {
|
||||
}
|
||||
|
||||
struct to_stringable {
|
||||
friend fmt::string_view to_string_view(to_stringable) { return {}; }
|
||||
friend auto to_string_view(to_stringable) -> fmt::string_view { return {}; }
|
||||
};
|
||||
|
||||
FMT_BEGIN_NAMESPACE
|
||||
|
@@ -873,11 +873,11 @@ struct custom_container {
|
||||
|
||||
using value_type = char;
|
||||
|
||||
size_t size() const { return 0; }
|
||||
auto size() const -> size_t { return 0; }
|
||||
void resize(size_t) {}
|
||||
|
||||
void push_back(char) {}
|
||||
char& operator[](size_t) { return data; }
|
||||
auto operator[](size_t) -> char& { return data; }
|
||||
};
|
||||
|
||||
FMT_BEGIN_NAMESPACE
|
||||
|
@@ -55,8 +55,8 @@ auto make_second(int s) -> std::tm {
|
||||
return time;
|
||||
}
|
||||
|
||||
std::string system_strftime(const std::string& format, const std::tm* timeptr,
|
||||
std::locale* locptr = nullptr) {
|
||||
auto system_strftime(const std::string& format, const std::tm* timeptr,
|
||||
std::locale* locptr = nullptr) -> std::string {
|
||||
auto loc = locptr ? *locptr : std::locale::classic();
|
||||
auto& facet = std::use_facet<std::time_put<char>>(loc);
|
||||
std::ostringstream os;
|
||||
@@ -73,8 +73,8 @@ std::string system_strftime(const std::string& format, const std::tm* timeptr,
|
||||
#endif
|
||||
}
|
||||
|
||||
FMT_CONSTEXPR std::tm make_tm(int year, int mon, int mday, int hour, int min,
|
||||
int sec) {
|
||||
FMT_CONSTEXPR auto make_tm(int year, int mon, int mday, int hour, int min,
|
||||
int sec) -> std::tm {
|
||||
auto tm = std::tm();
|
||||
tm.tm_sec = sec;
|
||||
tm.tm_min = min;
|
||||
@@ -336,12 +336,12 @@ TEST(chrono_test, local_time) {
|
||||
}
|
||||
|
||||
template <typename T, FMT_ENABLE_IF(fmt::detail::has_tm_gmtoff<T>::value)>
|
||||
bool set_tm_gmtoff(T& time, long offset) {
|
||||
auto set_tm_gmtoff(T& time, long offset) -> bool {
|
||||
time.tm_gmtoff = offset;
|
||||
return true;
|
||||
}
|
||||
template <typename T, FMT_ENABLE_IF(!fmt::detail::has_tm_gmtoff<T>::value)>
|
||||
bool set_tm_gmtoff(T&, long) {
|
||||
auto set_tm_gmtoff(T&, long) -> bool {
|
||||
return false;
|
||||
}
|
||||
|
||||
|
Reference in New Issue
Block a user