From a428366f8e410fb2f4f2b1df7cc1c1455ed31a1c Mon Sep 17 00:00:00 2001 From: 0xMRTT <0xMRTT@proton.me> Date: Sat, 17 Jun 2023 17:15:56 +0200 Subject: [PATCH] fix: last --- src/main.rs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/main.rs b/src/main.rs index 431b470..6866ffe 100644 --- a/src/main.rs +++ b/src/main.rs @@ -10,7 +10,7 @@ async fn main() -> Result<(), Box> { let r = ai.ask("Hello, world!", None).await?; - let response = r.last()?.text.clone(); + let response = r[r.len() - 1].text.clone(); println!("{:?}", response);