From 6bb5804bb8d675311334ae74c25b3999852078ff Mon Sep 17 00:00:00 2001 From: "github-actions[bot]" <41898282+github-actions[bot]@users.noreply.github.com> Date: Fri, 15 Nov 2024 11:05:38 +0000 Subject: [PATCH] style: clang-tidy auto fixes (#1735) Fixes #1734. Please review and commit clang-tidy fixes. Co-authored-by: kuznetsss <15742918+kuznetsss@users.noreply.github.com> --- src/rpc/CredentialHelpers.cpp | 1 - src/rpc/common/Validators.cpp | 5 +++-- src/rpc/handlers/DepositAuthorized.cpp | 2 -- src/rpc/handlers/LedgerEntry.cpp | 1 - tests/unit/rpc/RPCHelpersTests.cpp | 1 - tests/unit/rpc/handlers/DepositAuthorizedTests.cpp | 1 - 6 files changed, 3 insertions(+), 8 deletions(-) diff --git a/src/rpc/CredentialHelpers.cpp b/src/rpc/CredentialHelpers.cpp index adff73ac..bbea85ca 100644 --- a/src/rpc/CredentialHelpers.cpp +++ b/src/rpc/CredentialHelpers.cpp @@ -34,7 +34,6 @@ #include #include #include -#include #include #include #include diff --git a/src/rpc/common/Validators.cpp b/src/rpc/common/Validators.cpp index cfd875c3..47ea3e41 100644 --- a/src/rpc/common/Validators.cpp +++ b/src/rpc/common/Validators.cpp @@ -267,10 +267,11 @@ CustomValidator CustomValidators::CredentialTypeValidator = if (credTypeHex->empty()) return Error{Status{ClioError::rpcMALFORMED_AUTHORIZED_CREDENTIALS, std::string(key) + " is empty"}}; - if (credTypeHex->size() > ripple::maxCredentialTypeLength) + if (credTypeHex->size() > ripple::maxCredentialTypeLength) { return Error{ Status{ClioError::rpcMALFORMED_AUTHORIZED_CREDENTIALS, std::string(key) + " greater than max length"} }; +} return MaybeError{}; }}; @@ -281,7 +282,7 @@ CustomValidator CustomValidators::AuthorizeCredentialValidator = return Error{Status{ClioError::rpcMALFORMED_REQUEST, std::string(key) + " not array"}}; auto const& authCred = value.as_array(); - if (authCred.size() == 0) { + if (authCred.empty()) { return Error{Status{ ClioError::rpcMALFORMED_AUTHORIZED_CREDENTIALS, fmt::format("Requires at least one element in authorized_credentials array") diff --git a/src/rpc/handlers/DepositAuthorized.cpp b/src/rpc/handlers/DepositAuthorized.cpp index fc3f24c1..fb9c21e1 100644 --- a/src/rpc/handlers/DepositAuthorized.cpp +++ b/src/rpc/handlers/DepositAuthorized.cpp @@ -32,13 +32,11 @@ #include #include #include -#include #include #include #include #include #include -#include #include #include #include diff --git a/src/rpc/handlers/LedgerEntry.cpp b/src/rpc/handlers/LedgerEntry.cpp index 50675b4f..d27a0045 100644 --- a/src/rpc/handlers/LedgerEntry.cpp +++ b/src/rpc/handlers/LedgerEntry.cpp @@ -41,7 +41,6 @@ #include #include #include -#include #include #include #include diff --git a/tests/unit/rpc/RPCHelpersTests.cpp b/tests/unit/rpc/RPCHelpersTests.cpp index 0b99a5dc..7c972ec5 100644 --- a/tests/unit/rpc/RPCHelpersTests.cpp +++ b/tests/unit/rpc/RPCHelpersTests.cpp @@ -35,7 +35,6 @@ #include #include #include -#include #include #include #include diff --git a/tests/unit/rpc/handlers/DepositAuthorizedTests.cpp b/tests/unit/rpc/handlers/DepositAuthorizedTests.cpp index fc478a5a..68251f33 100644 --- a/tests/unit/rpc/handlers/DepositAuthorizedTests.cpp +++ b/tests/unit/rpc/handlers/DepositAuthorizedTests.cpp @@ -37,7 +37,6 @@ #include #include #include -#include #include #include