From 36e28b587f3b8b3e755f50e4e6488625e61275f7 Mon Sep 17 00:00:00 2001 From: shamardy Date: Mon, 11 Nov 2024 15:55:44 +0200 Subject: [PATCH] review fix: add display to all variants of `CustomTokenError` --- mm2src/coins/lp_coins.rs | 21 +++++++++++---------- 1 file changed, 11 insertions(+), 10 deletions(-) diff --git a/mm2src/coins/lp_coins.rs b/mm2src/coins/lp_coins.rs index 85ca97d6ed..5e40eb9221 100644 --- a/mm2src/coins/lp_coins.rs +++ b/mm2src/coins/lp_coins.rs @@ -4259,21 +4259,22 @@ pub enum CoinProtocol { #[derive(Clone, Debug, Deserialize, Display, PartialEq, Serialize)] pub enum CustomTokenError { - DuplicateTickerInConfig { - ticker_in_config: String, - }, - DuplicateContractInConfig { - ticker_in_config: String, - }, + #[display( + fmt = "Token with the same ticker already exists in coins configs, ticker in config: {}", + ticker_in_config + )] + DuplicateTickerInConfig { ticker_in_config: String }, + #[display( + fmt = "Token with the same contract address already exists in coins configs, ticker in config: {}", + ticker_in_config + )] + DuplicateContractInConfig { ticker_in_config: String }, #[display( fmt = "Token is already activated, ticker: {}, contract address: {}", ticker, contract_address )] - TokenWithSameContractAlreadyActivated { - ticker: String, - contract_address: String, - }, + TokenWithSameContractAlreadyActivated { ticker: String, contract_address: String }, } impl CoinProtocol {