mirror of
https://github.com/fmtlib/fmt.git
synced 2025-01-10 00:36:38 +00:00
Simplify path formatting
This commit is contained in:
parent
12acd7988b
commit
bb882c03bc
@ -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);
|
||||||
|
Loading…
Reference in New Issue
Block a user