From 879ae51196e9706a5381e92e698ee99cbc702271 Mon Sep 17 00:00:00 2001 From: Chris Ha Date: Sun, 17 Sep 2023 01:13:16 +0900 Subject: [PATCH] map_or interactive.rs --- binaries/llm-cli/src/interactive.rs | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/binaries/llm-cli/src/interactive.rs b/binaries/llm-cli/src/interactive.rs index b971d5d9..4657bc9d 100644 --- a/binaries/llm-cli/src/interactive.rs +++ b/binaries/llm-cli/src/interactive.rs @@ -165,8 +165,7 @@ fn session_ends_with_newline(session: &llm::InferenceSession) -> bool { session .decoded_tokens() .last() - .map(|t| *t == b'\n') - .unwrap_or(true) + .map_or(true, |t| *t == b'\n') } fn readline_loop(mut body: impl FnMut(String) -> eyre::Result<()>) -> eyre::Result<()> {