diff --git a/src/m3u8.rs b/src/m3u8.rs index 79f0a1f..3f258d5 100644 --- a/src/m3u8.rs +++ b/src/m3u8.rs @@ -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(()) } } diff --git a/src/main.rs b/src/main.rs index 64e82ca..e538ddf 100644 --- a/src/main.rs +++ b/src/main.rs @@ -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::(); + let choosen = user_wish.parse::(); match choosen { Ok(k) => { let search_result = search_result.as_ref().unwrap().clone();