diff --git a/src/server.rs b/src/server.rs index 304f8bc..1cc68ec 100644 --- a/src/server.rs +++ b/src/server.rs @@ -21,6 +21,20 @@ struct JsonRpcRequest { params: JsonValue, } +struct InputValidationError(String); +impl Error for InputValidationError {} + +impl Debug for InputValidationError { + fn fmt(&self, f: &mut Formatter<'_>) -> std::fmt::Result { + write!(f, "Error: {}", self.0) + } +} +impl Display for InputValidationError { + fn fmt(&self, f: &mut Formatter<'_>) -> std::fmt::Result { + write!(f, "Error: {}", self.0) + } +} + pub fn start_server(listen_at: &str, queue_size: usize, threads: u64) { let edges: Arc>> = Arc::new(RwLock::new(Arc::new(EdgeDB::default()))); @@ -134,21 +148,6 @@ fn load_safes_binary(edges: &RwLock>, file: &str) -> Result) -> std::fmt::Result { - write!(f, "Error: {}", self.0) - } -} -impl Display for InputValidationError { - fn fmt(&self, f: &mut Formatter<'_>) -> std::fmt::Result { - write!(f, "Error: {}", self.0) - } -} - -impl Error for InputValidationError {} - fn compute_transfer( request: JsonRpcRequest, edges: &EdgeDB,