From 2020bc06d5fc3470c750d83c22fbf57ca87e6093 Mon Sep 17 00:00:00 2001 From: jayt106 Date: Thu, 7 Nov 2024 21:15:12 -0500 Subject: [PATCH] refine --- core/node/da_clients/src/avail/client.rs | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/core/node/da_clients/src/avail/client.rs b/core/node/da_clients/src/avail/client.rs index 96bc258a5..4b9fe67f1 100644 --- a/core/node/da_clients/src/avail/client.rs +++ b/core/node/da_clients/src/avail/client.rs @@ -21,10 +21,8 @@ pub struct AvailClient { impl AvailClient { pub async fn new(config: AvailConfig, secrets: AvailSecrets) -> anyhow::Result { - let sdk_client = if secrets.private_key.is_some() { - let pk = secrets.private_key.clone().unwrap(); - - let bytes = Vec::from_hex(pk).map_err(|e| anyhow::anyhow!("hex string convert failed: {}", e.to_string()))?; + let sdk_client = if let Some(_pk) = &secrets.private_key { + let bytes = Vec::from_hex(_pk).map_err(|e| anyhow::anyhow!("hex string convert failed: {}", e.to_string()))?; if bytes.len() != 32 { return Err(anyhow::anyhow!("Hex string must represent exactly 32 bytes.")); }