lib/curl: use std::span

This commit is contained in:
Max Kellermann
2022-06-27 17:27:37 +02:00
committed by Max Kellermann
parent 062df65b1e
commit 1da09f5b1b
12 changed files with 32 additions and 33 deletions

View File

@@ -48,9 +48,9 @@ public:
i.first.c_str(), i.second.c_str());
}
void OnData(ConstBuffer<void> data) override {
void OnData(std::span<const std::byte> data) override {
try {
if (fwrite(data.data, data.size, 1, stdout) != 1)
if (fwrite(data.data(), data.size(), 1, stdout) != 1)
throw std::runtime_error("Failed to write");
} catch (...) {
OnError(std::current_exception());