From 214a5b5da186e394ee5133018af952b312766788 Mon Sep 17 00:00:00 2001 From: Nicolas Patry Date: Mon, 10 Mar 2025 18:42:27 +0100 Subject: [PATCH] Fmt. --- router/src/lib.rs | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/router/src/lib.rs b/router/src/lib.rs index 7370477b..eac41276 100644 --- a/router/src/lib.rs +++ b/router/src/lib.rs @@ -21,8 +21,8 @@ use serde::{Deserialize, Serialize}; use tokenizers::Encoding; use tracing::warn; use utoipa::ToSchema; -use validation::Validation; use uuid::Uuid; +use validation::Validation; #[allow(clippy::large_enum_variant)] #[derive(Clone)] @@ -997,11 +997,11 @@ impl ChatRequest { )) } - fn next_int_id(&self) -> Result>{ + fn next_int_id(&self) -> Result> { let mut id: usize = 0; - for message in &self.messages{ - if let MessageBody::Tool{tool_calls} = &message.body { - for tool_call in tool_calls{ + for message in &self.messages { + if let MessageBody::Tool { tool_calls } = &message.body { + for tool_call in tool_calls { let new_id: usize = tool_call.id.parse()?; id = std::cmp::max(id, new_id + 1); } @@ -1013,8 +1013,8 @@ impl ChatRequest { /// Try to have linearly increasing id /// or resort to using Uuid if the initial /// scheme is not understood - fn next_tool_call_id(&self) -> String{ - self.next_int_id().unwrap_or_else(|_|{ + fn next_tool_call_id(&self) -> String { + self.next_int_id().unwrap_or_else(|_| { let uid = Uuid::new_v4().to_string(); uid.to_string() })