lib/curl/Adapter: use std::string_view

This commit is contained in:
Max Kellermann 2022-06-28 11:34:04 +02:00 committed by Max Kellermann
parent 1da09f5b1b
commit 8783ed1981
3 changed files with 5 additions and 4 deletions

View File

@ -112,8 +112,10 @@ IsResponseBoundaryHeader(StringView s) noexcept
} }
inline void inline void
CurlResponseHandlerAdapter::HeaderFunction(StringView s) noexcept CurlResponseHandlerAdapter::HeaderFunction(std::string_view _s) noexcept
{ {
const StringView s{_s};
if (state > State::HEADERS) if (state > State::HEADERS)
return; return;

View File

@ -34,8 +34,8 @@
#include <curl/curl.h> #include <curl/curl.h>
#include <cstddef> #include <cstddef>
#include <string_view>
struct StringView;
class CurlEasy; class CurlEasy;
class CurlResponseHandler; class CurlResponseHandler;
@ -68,7 +68,7 @@ private:
void FinishHeaders(); void FinishHeaders();
void FinishBody(); void FinishBody();
void HeaderFunction(StringView s) noexcept; void HeaderFunction(std::string_view s) noexcept;
/** called by curl when a new header is available */ /** called by curl when a new header is available */
static std::size_t _HeaderFunction(char *ptr, static std::size_t _HeaderFunction(char *ptr,

View File

@ -35,7 +35,6 @@
#include <cstddef> #include <cstddef>
struct StringView;
class CurlGlobal; class CurlGlobal;
class CurlResponseHandler; class CurlResponseHandler;