replace serde with miniserde

This commit is contained in:
2021-10-30 12:17:14 +02:00
parent fcd49eb3be
commit aa6a8f1c74
5 changed files with 12 additions and 20 deletions

View File

@ -2,7 +2,6 @@ use std::{error, io};
use jsonrpc_core::{types::error::Error, ErrorCode};
use probes::ProbeError;
use serde_json::Error as SerdeError;
use snafu::Snafu;
pub type BoxError = Box<dyn error::Error>;
@ -24,9 +23,6 @@ pub enum StatError {
#[snafu(display("Failed to retrieve system uptime: {}", source))]
ReadUptime { source: io::Error },
#[snafu(display("JSON serialization failed: {}", source))]
SerdeSerialize { source: SerdeError },
}
impl From<StatError> for Error {
@ -57,11 +53,6 @@ impl From<StatError> for Error {
message: format!("Failed to retrieve system uptime: {}", source),
data: None,
},
StatError::SerdeSerialize { source } => Error {
code: ErrorCode::ServerError(-32002),
message: format!("JSON serialization failed: {}", source),
data: None,
},
}
}
}