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