From d548a08ab8650669291f2d66d6e8311127e421b9 Mon Sep 17 00:00:00 2001 From: aglkm <39521015+aglkm@users.noreply.github.com> Date: Thu, 14 Nov 2024 15:46:07 +0300 Subject: [PATCH] trim and lowercase search input --- src/main.rs | 3 +++ 1 file changed, 3 insertions(+) diff --git a/src/main.rs b/src/main.rs index 629e701..e182037 100644 --- a/src/main.rs +++ b/src/main.rs @@ -171,6 +171,9 @@ pub async fn search(input: Option<&str>) -> Either { })), }; + // Trim and lowercase the input + let input = input.trim().to_lowercase(); + // Check for valid chars if input.chars().all(|x| (x >= 'a' && x <= 'f') || (x >= '0' && x <= '9')) == true {