From faf9589706b0953adb85ceab41f3959e6d9c02d1 Mon Sep 17 00:00:00 2001 From: kageru Date: Sat, 13 Jun 2020 09:47:03 +0200 Subject: [PATCH] remove obsolete stuff --- src/main.rs | 20 -------------------- src/response.pest | 4 ++-- 2 files changed, 2 insertions(+), 22 deletions(-) diff --git a/src/main.rs b/src/main.rs index 810fec1..e4de75d 100644 --- a/src/main.rs +++ b/src/main.rs @@ -50,26 +50,6 @@ struct Song { } fn main() { - /* - let parsed = MpdParser::parse(Rule::response, input) - .expect("invalid response") - .next() - .unwrap(); - let last = parsed.into_inner().last().unwrap(); - match last.as_rule() { - Rule::ok => println!("response was ok"), - Rule::err => println!("response was an error"), - _ => unreachable!("Last response line should always be a status"), - } - let mut deser = MPDeserializer::from_str( - "Title: A song 星 - Artist: A name - OK mpd 0.21.23", - ) - .expect("broken deser"); - let d = Song::deserialize(&mut deser); - println!("{:?}", d); - */ let input_var: &str = "Title: A song 星 Artist: A name OK mpd 0.21.23"; diff --git a/src/response.pest b/src/response.pest index 9faad89..45974e0 100644 --- a/src/response.pest +++ b/src/response.pest @@ -1,5 +1,5 @@ -key = { ('a'..'z' | 'A'..'Z')+ } -val = { (!"\n" ~ ANY)* } +key = _{ ('a'..'z' | 'A'..'Z')+ } +val = _{ (!"\n" ~ ANY)* } kv = { key ~ ": " ~ val ~ "\n" } ok = { "OK" ~ " "? ~ val? } err = {"ACK" ~ " "? ~ val? }