lowercase

This commit is contained in:
Love 2023-01-19 14:14:35 +01:00
parent c7fff46ff3
commit dccb4f1c40
No known key found for this signature in database
GPG Key ID: A3C10DC241C8FA9F
3 changed files with 6 additions and 5 deletions

View File

@ -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()
}
}

View File

@ -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 {

View File

@ -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()
}