From ecf3df8c1569c6e1998a94755208970210ef8f0a Mon Sep 17 00:00:00 2001 From: lov3b Date: Thu, 19 Jan 2023 14:14:35 +0100 Subject: [PATCH] lowercase --- src/lib.rs | 2 +- src/main.rs | 5 +++-- src/parser.rs | 4 ++-- 3 files changed, 6 insertions(+), 5 deletions(-) diff --git a/src/lib.rs b/src/lib.rs index 6cf0b33..42fd186 100644 --- a/src/lib.rs +++ b/src/lib.rs @@ -60,6 +60,6 @@ impl<'a> Readline<'a> { self.stdout.flush().unwrap(); let mut buffer = String::new(); self.stdin.read_line(&mut buffer).unwrap(); - buffer + buffer.to_lowercase() } } diff --git a/src/main.rs b/src/main.rs index fd22a3f..938440b 100644 --- a/src/main.rs +++ b/src/main.rs @@ -60,11 +60,12 @@ async fn main() { refresh(&parser).await; continue; } else if user_wish == "d" { - let selection = readline.input("Download all or select in comma separated [a | 1,2,3,4]: "); + let selection = + readline.input("Download all or select in comma separated [a | 1,2,3,4]: "); let selection = selection.trim(); let to_download = loop { - break if selection.to_lowercase() == "a" { + break if selection == "a" { println!("Downloading all"); search_result.as_ref().unwrap().clone() } else { diff --git a/src/parser.rs b/src/parser.rs index bca5687..6f82618 100644 --- a/src/parser.rs +++ b/src/parser.rs @@ -35,10 +35,10 @@ impl Parser { } pub fn find(&self, name: &str) -> Vec<&M3u8> { - let name = name.to_uppercase(); + let name = name.to_lowercase(); self.m3u8_items .iter() - .filter(|item| item.name.to_uppercase().contains(&name) || item.tvg_id.contains(&name)) + .filter(|item| item.name.to_lowercase().contains(&name) || item.tvg_id.contains(&name)) .collect() }