Skip to content

Commit

Permalink
Fixes clippy issues
Browse files Browse the repository at this point in the history
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.
  • Loading branch information
sr-gi committed Jan 8, 2024
1 parent a4acced commit 7ff1d01
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions watchtower-plugin/src/convert.rs
Original file line number Diff line number Diff line change
Expand Up @@ -94,6 +94,8 @@ impl RegisterParams {
impl TryFrom<serde_json::Value> 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<Self, Self::Error> {
match value {
serde_json::Value::String(s) => {
Expand Down Expand Up @@ -193,6 +195,8 @@ pub struct GetAppointmentParams {
impl TryFrom<serde_json::Value> 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<Self, Self::Error> {
match value {
serde_json::Value::Array(a) => {
Expand Down

0 comments on commit 7ff1d01

Please sign in to comment.