Simplify path formatting

This commit is contained in:
Victor Zverovich 2024-03-19 07:47:42 +09:00
parent 12acd7988b
commit bb882c03bc

View File

@ -149,11 +149,9 @@ template <typename Char> struct formatter<std::filesystem::path, Char> {
template <typename FormatContext> template <typename FormatContext>
auto format(const std::filesystem::path& p, FormatContext& ctx) const { auto format(const std::filesystem::path& p, FormatContext& ctx) const {
auto specs = specs_; auto specs = specs_;
# ifdef _WIN32 auto path_string =
auto path_string = !path_type_ ? p.native() : p.generic_wstring(); !path_type_ ? p.native()
# else : p.generic_string<std::filesystem::path::value_type>();
auto path_string = !path_type_ ? p.native() : p.generic_string();
# endif
detail::handle_dynamic_spec<detail::width_checker>(specs.width, width_ref_, detail::handle_dynamic_spec<detail::width_checker>(specs.width, width_ref_,
ctx); ctx);