From d97c68ee46766f9369f116d7f0084dbf81918a85 Mon Sep 17 00:00:00 2001 From: Mehul Date: Wed, 18 Dec 2024 16:36:58 -0500 Subject: [PATCH] refactor: lint fixes --- src/cli/llm/infer_type_name.rs | 5 +++-- src/cli/llm/wizard.rs | 12 +++++++----- 2 files changed, 10 insertions(+), 7 deletions(-) diff --git a/src/cli/llm/infer_type_name.rs b/src/cli/llm/infer_type_name.rs index 0a0ca20dd1..2f2812c7d2 100644 --- a/src/cli/llm/infer_type_name.rs +++ b/src/cli/llm/infer_type_name.rs @@ -145,8 +145,9 @@ impl InferTypeName { total ); - // TODO: case where suggested names are already used, then extend the base - // question with `suggest different names, we have already used following + // TODO: case where suggested names are already used, then + // extend the base question with + // `suggest different names, we have already used following // names: [names list]` } Err(e) => { diff --git a/src/cli/llm/wizard.rs b/src/cli/llm/wizard.rs index 46c7a3288b..90a063626c 100644 --- a/src/cli/llm/wizard.rs +++ b/src/cli/llm/wizard.rs @@ -3,11 +3,12 @@ use genai::adapter::AdapterKind; use genai::chat::{ChatOptions, ChatRequest, ChatResponse}; use genai::resolver::AuthResolver; use genai::Client; -use super::error::{Error, Result}; -use reqwest::{StatusCode}; -use tokio_retry::strategy::{ExponentialBackoff}; +use reqwest::StatusCode; +use tokio_retry::strategy::ExponentialBackoff; use tokio_retry::RetryIf; +use super::error::{Error, Result}; + #[derive(Setters, Clone)] pub struct Wizard { client: Client, @@ -57,7 +58,8 @@ impl Wizard { .exec_chat(self.model.as_str(), request, None) // Execute chat request .await .map_err(Error::from) - .and_then(A::try_from) // Convert the response into the desired result + .and_then(A::try_from) // Convert the response into the + // desired result }, |err: &Error| { // Check if the error is a ReqwestError and if the status is 429 @@ -67,7 +69,7 @@ impl Wizard { } } false - } + }, ) .await }