From f2da435af85174205ee3865fb398f8737db090f0 Mon Sep 17 00:00:00 2001 From: Andre Bandarra Date: Thu, 29 Feb 2024 12:36:20 +0000 Subject: [PATCH] Makes Error details optional - Makes Error details option, as many types don't return the field. - Removes dangling println statement. --- src/client.rs | 1 - src/types/error.rs | 2 +- 2 files changed, 1 insertion(+), 2 deletions(-) diff --git a/src/client.rs b/src/client.rs index dea9d1d..04de237 100644 --- a/src/client.rs +++ b/src/client.rs @@ -191,7 +191,6 @@ impl GeminiClient { .send() .await?; let txt_json = resp.text().await?; - println!("{}", txt_json); Ok(serde_json::from_str::(&txt_json)?) } } diff --git a/src/types/error.rs b/src/types/error.rs index 4225230..25c40ec 100644 --- a/src/types/error.rs +++ b/src/types/error.rs @@ -5,7 +5,7 @@ pub struct Error { pub code: i32, pub message: String, pub status: String, - pub details: Vec, + pub details: Option>, } #[derive(Clone, Debug, Serialize, Deserialize)]