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>
auto format(const std::filesystem::path& p, FormatContext& ctx) const {
auto specs = specs_;
# ifdef _WIN32
auto path_string = !path_type_ ? p.native() : p.generic_wstring();
# else
auto path_string = !path_type_ ? p.native() : p.generic_string();
# endif
auto path_string =
!path_type_ ? p.native()
: p.generic_string<std::filesystem::path::value_type>();
detail::handle_dynamic_spec<detail::width_checker>(specs.width, width_ref_,
ctx);