]>
Commit | Line | Data |
---|---|---|
2d8bf486 JP |
1 | From c8237437d27fa255f4d8a380dec6db872d139e7d Mon Sep 17 00:00:00 2001 |
2 | From: Jan Palus <jpalus@fastmail.com> | |
3 | Date: Tue, 15 Aug 2023 20:57:07 +0200 | |
4 | Subject: [PATCH] Explicitly cast ustring to string when passing to fmt | |
5 | ||
6 | don't rely on implicit conversion which is no longer present in fmt | |
7 | 10.1.0 | |
8 | ||
9 | Fixes #2403 | |
10 | --- | |
11 | include/util/format.hpp | 2 +- | |
12 | src/modules/sni/item.cpp | 2 +- | |
13 | 2 files changed, 2 insertions(+), 2 deletions(-) | |
14 | ||
15 | diff --git a/include/util/format.hpp b/include/util/format.hpp | |
16 | index 00b6a31..069d889 100644 | |
17 | --- a/include/util/format.hpp | |
18 | +++ b/include/util/format.hpp | |
19 | @@ -93,7 +93,7 @@ template <> | |
20 | struct formatter<Glib::ustring> : formatter<std::string> { | |
21 | template <typename FormatContext> | |
22 | auto format(const Glib::ustring& value, FormatContext& ctx) { | |
23 | - return formatter<std::string>::format(value, ctx); | |
24 | + return formatter<std::string>::format(static_cast<std::string>(value), ctx); | |
25 | } | |
26 | }; | |
27 | } // namespace fmt | |
28 | diff --git a/src/modules/sni/item.cpp b/src/modules/sni/item.cpp | |
29 | index 9d3fc4b..871621f 100644 | |
30 | --- a/src/modules/sni/item.cpp | |
31 | +++ b/src/modules/sni/item.cpp | |
32 | @@ -22,7 +22,7 @@ struct fmt::formatter<Glib::VariantBase> : formatter<std::string> { | |
33 | template <typename FormatContext> | |
34 | auto format(const Glib::VariantBase& value, FormatContext& ctx) { | |
35 | if (is_printable(value)) { | |
36 | - return formatter<std::string>::format(value.print(), ctx); | |
37 | + return formatter<std::string>::format(static_cast<std::string>(value.print()), ctx); | |
38 | } else { | |
39 | return formatter<std::string>::format(value.get_type_string(), ctx); | |
40 | } | |
41 | -- | |
42 | 2.41.0 | |
43 |