]> git.apps.os.sepia.ceph.com Git - ceph.git/commitdiff
common/hobject: make hobject_t formatter methods const 57484/head
authorMatan Breizman <mbreizma@redhat.com>
Wed, 8 May 2024 09:52:19 +0000 (12:52 +0300)
committerMatan Breizman <mbreizma@redhat.com>
Wed, 15 May 2024 15:02:49 +0000 (18:02 +0300)
this is an alternative to 6021129f0c5c1c133436e471741c73f6e315c5dd
Since https://github.com/ceph/ceph/pull/55583 is not backported to S.

Signed-off-by: Matan Breizman <mbreizma@redhat.com>
src/common/hobject_fmt.h

index 622611121ae6fb680a9d83cd505987dcd37c8ac7..ce0424cdb1296ff2cc760073fd56dc11b7356292 100644 (file)
@@ -28,9 +28,10 @@ static inline void append_out_escaped(const std::string& in, std::string* out)
 
 template <> struct fmt::formatter<hobject_t> {
 
-  constexpr auto parse(format_parse_context& ctx) { return ctx.begin(); }
+  constexpr auto parse(format_parse_context& ctx) const { return ctx.begin(); }
 
-  template <typename FormatContext> auto format(const hobject_t& ho, FormatContext& ctx)
+  template <typename FormatContext> auto
+  format(const hobject_t& ho, FormatContext& ctx) const
   {
     if (ho == hobject_t{}) {
       return fmt::format_to(ctx.out(), "MIN");