fixed s and better write of m3u8

This commit is contained in:
Love 2023-01-17 18:10:27 +01:00
parent 2c52b4fcfa
commit 7e5d1f3651
2 changed files with 7 additions and 3 deletions

View File

@ -18,7 +18,7 @@ impl Display for M3u8 {
} else {
self.name.bold()
};
f.write_fmt(format_args!("{}({})", colored_name, self.link))?;
f.write_fmt(format_args!("{} ({})", colored_name, self.link))?;
Ok(())
}
}

View File

@ -44,12 +44,16 @@ fn main() {
buf = String::new();
stdin.read_line(&mut buf).unwrap();
let user_wish = buf.trim();
// If they want to quit, let them-
if buf.trim() == "q" {
if user_wish == "q" {
break;
} else if user_wish == "s" {
search_result = None;
continue;
}
let choosen = buf.trim().parse::<usize>();
let choosen = user_wish.parse::<usize>();
match choosen {
Ok(k) => {
let search_result = search_result.as_ref().unwrap().clone();