From 7ff1d01ef7e021c85c1ef4efbeb53ffc998b0b75 Mon Sep 17 00:00:00 2001 From: Sergi Delgado Segura Date: Mon, 8 Jan 2024 13:38:59 -0500 Subject: [PATCH] Fixes clippy issues Clippy is complaining about using `.get(0)` instead of `.fist()` in methods where we are getting more than just the first item. Suppress those warning. Also fixes some actual issues. --- watchtower-plugin/src/convert.rs | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/watchtower-plugin/src/convert.rs b/watchtower-plugin/src/convert.rs index ec1b9d01..77ca95ab 100644 --- a/watchtower-plugin/src/convert.rs +++ b/watchtower-plugin/src/convert.rs @@ -94,6 +94,8 @@ impl RegisterParams { impl TryFrom for RegisterParams { type Error = RegisterError; + // clippy-fix: We are getting more than just the first item, so this clippy check does not make sense here + #[allow(clippy::get_first)] fn try_from(value: serde_json::Value) -> Result { match value { serde_json::Value::String(s) => { @@ -193,6 +195,8 @@ pub struct GetAppointmentParams { impl TryFrom for GetAppointmentParams { type Error = GetAppointmentError; + // clippy-fix: We are getting more than just the first item, so this clippy check does not make sense here + #[allow(clippy::get_first)] fn try_from(value: serde_json::Value) -> Result { match value { serde_json::Value::Array(a) => {