mtxclient/SOURCES/mtxclient-0.12.0-fmt11-fix....

39 lines
1.7 KiB
Diff

From 4a4726c77123f805cff8b954909663eaed296558 Mon Sep 17 00:00:00 2001
From: Kefu Chai <tchaikov@gmail.com>
Date: Mon, 15 Jul 2024 11:35:09 +0800
Subject: [PATCH] Fix build with fmt 11
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
fmt 11 enforces that fmt::formatter<..>::format() should be const.
so let's mark the `format()` with `const` specifier.
Signed-off-by: Kefu Chai <tchaikov@gmail.com>
---
include/mtxclient/http/errors.hpp | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/include/mtxclient/http/errors.hpp b/include/mtxclient/http/errors.hpp
index 2d0e7a45..b99ff90e 100644
--- a/include/mtxclient/http/errors.hpp
+++ b/include/mtxclient/http/errors.hpp
@@ -87,7 +87,7 @@ struct fmt::formatter<mtx::http::ClientError>
// Formats the point p using the parsed format specification (presentation)
// stored in this formatter.
template<typename FormatContext>
- auto format(const mtx::http::ClientError &e, FormatContext &ctx) -> decltype(ctx.out())
+ auto format(const mtx::http::ClientError &e, FormatContext &ctx) const -> decltype(ctx.out())
{
// ctx.out() is an output iterator to write to.
bool prepend_comma = false;
@@ -132,7 +132,7 @@ struct fmt::formatter<std::optional<mtx::http::ClientError>> : formatter<mtx::ht
{
// parse is inherited from formatter<string_view>.
template<typename FormatContext>
- auto format(std::optional<mtx::http::ClientError> c, FormatContext &ctx)
+ auto format(std::optional<mtx::http::ClientError> c, FormatContext &ctx) const
{
if (!c)
return fmt::format_to(ctx.out(), "(no error)");