mirror of
https://github.com/bitcoin/bitcoin.git
synced 2025-12-13 22:24:05 +01:00
Merge #19004: refactor: Replace const char* to std::string
c57f03ce17refactor: Replace const char* to std::string (Calvin Kim) Pull request description: Rationale: Addresses #19000 Some functions should be returning std::string instead of const char*. This commit changes that. Main benefits/reasoning: 1. The functions never return nullptr, so returning a string makes code at call sites easier to review (reviewers don't have to read the source code to verify that a nullptr is never returned) 2. All call sites convert to string anyway ACKs for top commit: MarcoFalke: re-ACKc57f03ce17(no changes since previous review) 🚃 Empact: Fair enough, Code Review ACKc57f03ce17practicalswift: ACKc57f03ce17-- patch looks correct hebasto: re-ACKc57f03ce17Tree-SHA512: 9ce99bb38fe399b54844315048204cafce0f27fd8f24cae357fa7ac6f5d8094d57bbf5f5c1f5878a65f2d35e4a3f95d527eb17f49250b690c591c0df86ca84fd
This commit is contained in:
@@ -21,6 +21,7 @@
|
||||
#include <functional>
|
||||
#include <memory>
|
||||
#include <stdio.h>
|
||||
#include <string>
|
||||
#include <tuple>
|
||||
|
||||
#include <event2/buffer.h>
|
||||
@@ -158,7 +159,7 @@ struct HTTPReply
|
||||
std::string body;
|
||||
};
|
||||
|
||||
static const char *http_errorstring(int code)
|
||||
static std::string http_errorstring(int code)
|
||||
{
|
||||
switch(code) {
|
||||
#if LIBEVENT_VERSION_NUMBER >= 0x02010300
|
||||
|
||||
Reference in New Issue
Block a user