diff --git a/src/rpc/RPCCenter.cpp b/src/rpc/RPCCenter.cpp index 74e079b1..ce2e9bb1 100644 --- a/src/rpc/RPCCenter.cpp +++ b/src/rpc/RPCCenter.cpp @@ -29,7 +29,7 @@ namespace { std::unordered_set const& handledRpcs() { - static std::unordered_set kHANDLED_RPCS = { + static std::unordered_set const kHANDLED_RPCS = { "account_channels", "account_currencies", "account_info", diff --git a/src/web/dosguard/Weights.cpp b/src/web/dosguard/Weights.cpp index bed67ffe..e15a0e40 100644 --- a/src/web/dosguard/Weights.cpp +++ b/src/web/dosguard/Weights.cpp @@ -66,7 +66,7 @@ Weights::requestWeight(boost::json::object const& request) const return defaultWeight_; } - std::string_view cmd = + std::string_view const cmd = request.contains(JS(method)) ? request.at(JS(method)).as_string() : request.at(JS(command)).as_string(); auto it = weights_.find(cmd); diff --git a/src/web/impl/WsBase.hpp b/src/web/impl/WsBase.hpp index 6651e4f9..0538a34e 100644 --- a/src/web/impl/WsBase.hpp +++ b/src/web/impl/WsBase.hpp @@ -309,7 +309,7 @@ private: e["id"] = request.as_object().at("id"); e["request"] = std::move(request); } catch (std::exception const&) { - e["request"] = std::move(requestStr); + e["request"] = requestStr; } this->send(std::make_shared(boost::json::serialize(e))); diff --git a/src/web/ng/impl/ConnectionHandler.cpp b/src/web/ng/impl/ConnectionHandler.cpp index 2bcbfb65..838c4bfb 100644 --- a/src/web/ng/impl/ConnectionHandler.cpp +++ b/src/web/ng/impl/ConnectionHandler.cpp @@ -45,7 +45,6 @@ #include #include #include -#include #include namespace web::ng::impl { diff --git a/tests/unit/util/StringHashTests.cpp b/tests/unit/util/StringHashTests.cpp index af16efc8..0be36452 100644 --- a/tests/unit/util/StringHashTests.cpp +++ b/tests/unit/util/StringHashTests.cpp @@ -30,7 +30,7 @@ using namespace util; TEST(StringHashTest, HashesConsistently) { - StringHash hasher; + StringHash const hasher; std::string const stdString = "test string"; std::string_view const strView = "test string"; @@ -43,7 +43,7 @@ TEST(StringHashTest, HashesConsistently) TEST(StringHashTest, TransparentLookup) { - std::unordered_set> stringSet{"hello world"}; + std::unordered_set> const stringSet{"hello world"}; std::string const stdString = "hello world"; std::string_view const strView = "hello world"; @@ -58,7 +58,7 @@ TEST(StringHashTest, TransparentLookup) TEST(StringHashTest, EmptyStrings) { - StringHash hasher; + StringHash const hasher; std::string const emptyStdString; std::string_view const emptyStrView; diff --git a/tests/unit/util/newconfig/ConfigConstraintsTests.cpp b/tests/unit/util/newconfig/ConfigConstraintsTests.cpp index 911ac29d..173d125b 100644 --- a/tests/unit/util/newconfig/ConfigConstraintsTests.cpp +++ b/tests/unit/util/newconfig/ConfigConstraintsTests.cpp @@ -28,7 +28,7 @@ struct RpcNameConstraintTest : testing::Test {}; TEST_F(RpcNameConstraintTest, WrongType) { - Value value{1}; + Value const value{1}; auto const maybeError = gRpcNameConstraint.checkConstraint(value); ASSERT_TRUE(maybeError.has_value()); EXPECT_EQ(maybeError->error, "RPC command name must be a string"); @@ -36,7 +36,7 @@ TEST_F(RpcNameConstraintTest, WrongType) TEST_F(RpcNameConstraintTest, WrongValue) { - Value value{"non_existing_rpc"}; + Value const value{"non_existing_rpc"}; auto const maybeError = gRpcNameConstraint.checkConstraint(value); ASSERT_TRUE(maybeError.has_value()); EXPECT_EQ(maybeError->error, "Invalid RPC command name"); @@ -44,7 +44,7 @@ TEST_F(RpcNameConstraintTest, WrongValue) TEST_F(RpcNameConstraintTest, CorrectValue) { - Value value{"server_info"}; + Value const value{"server_info"}; auto const maybeError = gRpcNameConstraint.checkConstraint(value); ASSERT_FALSE(maybeError.has_value()); }