From 5800e7966db4ddd85fd81a33179c31d24439eb3c Mon Sep 17 00:00:00 2001 From: borispovod Date: Fri, 24 Nov 2023 04:03:18 +0400 Subject: [PATCH] fix: cargo checks --- bin/magi.rs | 4 ++-- src/types/common.rs | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/bin/magi.rs b/bin/magi.rs index 0f84a66b..a752e221 100644 --- a/bin/magi.rs +++ b/bin/magi.rs @@ -201,8 +201,8 @@ impl TryFrom for CliConfig { /// The incoming value is the path to the key or a string with the key. /// The private key must be in hexadecimal format with a length of 64 characters. fn parse_secret_key_from_cli(value: &str) -> Result { - secret_key_from_hex(value).or_else(|err| { - let path = PathBuf::try_from(value).map_err(|_| err)?; + secret_key_from_hex(value).or_else(|_| { + let path = PathBuf::from(value); let key_string = fs::read_to_string(&path) .map_err(|_| anyhow!("The key file {path:?} was not found."))? .trim() diff --git a/src/types/common.rs b/src/types/common.rs index a6a94e94..3d7c0be3 100644 --- a/src/types/common.rs +++ b/src/types/common.rs @@ -94,7 +94,7 @@ impl TryFrom<&ExecutionPayload> for HeadInfo { fn try_from(payload: &ExecutionPayload) -> Result { let (epoch, seq_number) = payload .transactions - .get(0) + .first() .ok_or(eyre::eyre!("no deposit transaction"))? .derive_unsafe_epoch()?;