chiark
/
gitweb
/
~ianmdlvl
/
otter.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
b095895
)
use lexpr for commands
author
Ian Jackson
<ijackson@chiark.greenend.org.uk>
Sat, 25 Jul 2020 18:39:30 +0000
(19:39 +0100)
committer
Ian Jackson
<ijackson@chiark.greenend.org.uk>
Sat, 25 Jul 2020 18:39:30 +0000
(19:39 +0100)
src/cmdlistener.rs
patch
|
blob
|
history
diff --git
a/src/cmdlistener.rs
b/src/cmdlistener.rs
index e2c64ba8f1cac9682fadfc2c3cc43fbf22210585..694a6ec3e4f803706649dabcb59c68339ea2068c 100644
(file)
--- a/
src/cmdlistener.rs
+++ b/
src/cmdlistener.rs
@@
-40,8
+40,8
@@
impl CommandStream {
}
}
-impl From<serde_
json
::Error> for MgmtError {
- fn from(je: serde_
json
::Error) -> ME {
+impl From<serde_
lexpr
::Error> 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)?
}