From 5532b50c0292ff6e773e00dbe7dfc1d0409c9f1e Mon Sep 17 00:00:00 2001 From: scald <1215913+scald@users.noreply.github.com> Date: Mon, 25 Nov 2024 14:48:21 +0200 Subject: [PATCH] Add Default trait to TokenUsage struct --- src/providers/mod.rs | 10 +--------- 1 file changed, 1 insertion(+), 9 deletions(-) diff --git a/src/providers/mod.rs b/src/providers/mod.rs index f994d0d..73f9df4 100644 --- a/src/providers/mod.rs +++ b/src/providers/mod.rs @@ -8,21 +8,13 @@ pub use openai::OpenAIProvider; use serde::Serialize; #[derive(Debug, Clone, Serialize)] +#[derive(Default)] pub struct TokenUsage { pub prompt_tokens: usize, pub completion_tokens: usize, pub total_tokens: usize, } -impl Default for TokenUsage { - fn default() -> Self { - Self { - prompt_tokens: 0, - completion_tokens: 0, - total_tokens: 0, - } - } -} #[derive(Debug, Clone, Copy)] pub enum AIProvider {