Fix conversion warning in filesystem::path formatter (#3806)

* Fix conversion warning in filesystem::path formatter

Use template character type to eliminate MSVC conversion warning when
formatting a wide chararacter path:

fmt\std.h(140,49): warning C4244: '=': conversion from 'const Char' to 'char', possible loss of data

* Review: use to_ascii instead

---------

Co-authored-by: Hans-Martin B. Jensen <haje@eposaudio.com>
This commit is contained in:
Hans-Martin B. Jensen 2024-01-13 17:02:31 +01:00 committed by GitHub
parent 1b55d10305
commit 7c163acfda
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -137,7 +137,7 @@ template <typename Char> struct formatter<std::filesystem::path, Char> {
debug_ = true;
++it;
}
if (it != end && (*it == 'g')) path_type_ = *it++;
if (it != end && (*it == 'g')) path_type_ = detail::to_ascii(*it++);
return it;
}