Skip to content

Commit

Permalink
Simplify path formatting
Browse files Browse the repository at this point in the history
  • Loading branch information
vitaut authored and happymonkey1 committed Apr 6, 2024
1 parent cf5cba6 commit ebb271e
Showing 1 changed file with 3 additions and 5 deletions.
8 changes: 3 additions & 5 deletions include/fmt/std.h
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand Down

0 comments on commit ebb271e

Please sign in to comment.