From e921c0b40bb09bb32cf3f3ce8eb8e3b21d5e3abd Mon Sep 17 00:00:00 2001 From: Max Kellermann Date: Fri, 1 Jul 2022 11:00:55 +0200 Subject: [PATCH] lib/yajl/Callbacks: use std::string_view --- src/lib/yajl/Callbacks.hxx | 14 +++++++++----- 1 file changed, 9 insertions(+), 5 deletions(-) diff --git a/src/lib/yajl/Callbacks.hxx b/src/lib/yajl/Callbacks.hxx index 643c3a0cd..05b7e9272 100644 --- a/src/lib/yajl/Callbacks.hxx +++ b/src/lib/yajl/Callbacks.hxx @@ -31,7 +31,8 @@ #define YAJL_CALLBACKS_HXX #include "util/Cast.hxx" -#include "util/StringView.hxx" + +#include #include @@ -53,8 +54,9 @@ struct CallbacksWrapper { static int String(void *ctx, const unsigned char *stringVal, size_t stringLen) noexcept { - return Cast(ctx).String(StringView((const char *)stringVal, - stringLen)); + return Cast(ctx).String(std::string_view{ + (const char *)stringVal, stringLen, + }); } static int StartMap(void *ctx) noexcept { @@ -63,8 +65,10 @@ struct CallbacksWrapper { static int MapKey(void *ctx, const unsigned char *key, size_t stringLen) noexcept { - return Cast(ctx).MapKey(StringView((const char *)key, - stringLen)); + return Cast(ctx).MapKey(std::string_view{ + (const char *)key, + stringLen, + }); } static int EndMap(void *ctx) noexcept {