refactor: Enable clang-tidy bugprone-unused-return-value

This requires some small refactors to silence false-positive warnings.

Also, expand the bugprone-unused-return-value.CheckedReturnTypes option
to include util::Result, and util::Expected.
This commit is contained in:
MarcoFalke
2025-12-06 10:31:54 +01:00
parent fa114be27b
commit faa23738fc
6 changed files with 10 additions and 6 deletions

View File

@@ -330,7 +330,7 @@ static void http_request_cb(struct evhttp_request* req, void* arg)
std::unique_ptr<HTTPWorkItem> item(new HTTPWorkItem(std::move(hreq), path, i->handler));
assert(g_work_queue);
if (g_work_queue->Enqueue(item.get())) {
item.release(); /* if true, queue took ownership */
[[maybe_unused]] auto _{item.release()}; /* if true, queue took ownership */
} else {
LogWarning("Request rejected because http work queue depth exceeded, it can be increased with the -rpcworkqueue= setting");
item->req->WriteReply(HTTP_SERVICE_UNAVAILABLE, "Work queue depth exceeded");