fix: Silence -Wunused-variable on the asset asserts

Mark the `Asset const asset` local in addVaultAssets and removeVaultAssets
as [[maybe_unused]]: it is only referenced from XRPL_ASSERT, which is
compiled out in Release (NDEBUG) builds, so clang's -Werror,
-Wunused-variable was breaking the ubuntu-clang-release-amd64 CI job.
The moveVaultAssets copy is used in real code paths and is unaffected.
This commit is contained in:
Vito
2026-08-10 13:29:19 +02:00
parent 72f75cbf43
commit d6565f0e4d

View File

@@ -185,7 +185,7 @@ addVaultAssets(
{
XRPL_ASSERT(vault && vault->getType() == ltVAULT, "xrpl::addVaultAssets : valid Vault sle");
Asset const asset = vault->at(sfAsset);
[[maybe_unused]] Asset const asset = vault->at(sfAsset);
XRPL_ASSERT(amount.asset() == asset, "xrpl::addVaultAssets : amount matches vault asset");
XRPL_ASSERT(
valueDelta.asset() == asset, "xrpl::addVaultAssets : valueDelta matches vault asset");
@@ -300,7 +300,7 @@ removeVaultAssets(
{
XRPL_ASSERT(vault && vault->getType() == ltVAULT, "xrpl::removeVaultAssets : valid Vault sle");
Asset const asset = vault->at(sfAsset);
[[maybe_unused]] Asset const asset = vault->at(sfAsset);
XRPL_ASSERT(amount.asset() == asset, "xrpl::removeVaultAssets : amount matches vault asset");
XRPL_ASSERT(amount >= beast::kZero, "xrpl::removeVaultAssets : amount is non-negative");