From: Ian Jackson Date: Sat, 25 Jul 2020 18:39:30 +0000 (+0100) Subject: use lexpr for commands X-Git-Tag: otter-0.2.0~1265 X-Git-Url: https://www.chiark.greenend.org.uk/ucgi/~ianmdlvl/git?a=commitdiff_plain;h=a15b561e614834cd6362b145dadc8cdeb4a6a124;p=otter.git use lexpr for commands --- diff --git a/src/cmdlistener.rs b/src/cmdlistener.rs index e2c64ba8..694a6ec3 100644 --- a/src/cmdlistener.rs +++ b/src/cmdlistener.rs @@ -40,8 +40,8 @@ impl CommandStream { } } -impl From for MgmtError { - fn from(je: serde_json::Error) -> ME { +impl From for MgmtError { + fn from(je: serde_lexpr::Error) -> ME { ParseFailed(format!("{}", &je)) } } @@ -59,7 +59,7 @@ pub fn decode_and_process(s: &str) -> MgmtResponse { #[throws(ME)] fn decode_process_inner(s: &str)-> MgmtResponse { - let cmd : MgmtCommand = serde_json::from_str(s)?; + let cmd : MgmtCommand = serde_lexpr::from_str(s)?; execute(cmd)? }