Merge pull request #2409 from jpalus/fmt-cast-ustring-to-string

pull/2412/head
Alexis Rouillard 2023-08-15 22:35:46 +02:00 committed by GitHub
commit 66b71cc857
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 2 additions and 2 deletions

View File

@ -93,7 +93,7 @@ template <>
struct formatter<Glib::ustring> : formatter<std::string> {
template <typename FormatContext>
auto format(const Glib::ustring& value, FormatContext& ctx) {
return formatter<std::string>::format(value, ctx);
return formatter<std::string>::format(static_cast<std::string>(value), ctx);
}
};
} // namespace fmt

View File

@ -22,7 +22,7 @@ struct fmt::formatter<Glib::VariantBase> : formatter<std::string> {
template <typename FormatContext>
auto format(const Glib::VariantBase& value, FormatContext& ctx) {
if (is_printable(value)) {
return formatter<std::string>::format(value.print(), ctx);
return formatter<std::string>::format(static_cast<std::string>(value.print()), ctx);
} else {
return formatter<std::string>::format(value.get_type_string(), ctx);
}