diff options
Diffstat (limited to 'rust/src')
-rw-r--r-- | rust/src/api_server.rs | 37 | ||||
-rw-r--r-- | rust/src/bin/fatcatd.rs | 5 |
2 files changed, 25 insertions, 17 deletions
diff --git a/rust/src/api_server.rs b/rust/src/api_server.rs index c8b1f012..61005226 100644 --- a/rust/src/api_server.rs +++ b/rust/src/api_server.rs @@ -1159,17 +1159,19 @@ impl Api for Server { _context: &Context, ) -> Box<Future<Item = GetEditorChangelogResponse, Error = ApiError> + Send> { let ret = match self.editor_changelog_get_handler(username.clone()) { - Ok(entries) => - GetEditorChangelogResponse::FoundMergedChanges(entries), - Err(Error(ErrorKind::Diesel(::diesel::result::Error::NotFound), _)) => - GetEditorChangelogResponse::NotFound( - ErrorResponse { message: format!("No such editor: {}", username.clone()) }), + Ok(entries) => GetEditorChangelogResponse::FoundMergedChanges(entries), + Err(Error(ErrorKind::Diesel(::diesel::result::Error::NotFound), _)) => { + GetEditorChangelogResponse::NotFound(ErrorResponse { + message: format!("No such editor: {}", username.clone()), + }) + } Err(e) => { // TODO: dig in to error type here error!("{}", e); - GetEditorChangelogResponse::GenericError( - ErrorResponse { message: e.to_string() }) - }, + GetEditorChangelogResponse::GenericError(ErrorResponse { + message: e.to_string(), + }) + } }; Box::new(futures::done(Ok(ret))) } @@ -1180,16 +1182,19 @@ impl Api for Server { _context: &Context, ) -> Box<Future<Item = GetEditorResponse, Error = ApiError> + Send> { let ret = match self.get_editor_handler(username.clone()) { - Ok(entity) => - GetEditorResponse::FoundEditor(entity), - Err(Error(ErrorKind::Diesel(::diesel::result::Error::NotFound), _)) => - GetEditorResponse::NotFound( - ErrorResponse { message: format!("No such editor: {}", username.clone()) }), + Ok(entity) => GetEditorResponse::FoundEditor(entity), + Err(Error(ErrorKind::Diesel(::diesel::result::Error::NotFound), _)) => { + GetEditorResponse::NotFound(ErrorResponse { + message: format!("No such editor: {}", username.clone()), + }) + } Err(e) => { // TODO: dig in to error type here error!("{}", e); - GetEditorResponse::GenericError(ErrorResponse { message: e.to_string() }) - }, + GetEditorResponse::GenericError(ErrorResponse { + message: e.to_string(), + }) + } }; Box::new(futures::done(Ok(ret))) } @@ -1206,7 +1211,7 @@ impl Api for Server { GetStatsResponse::GenericError(ErrorResponse { message: e.to_string(), }) - }, + } }; Box::new(futures::done(Ok(ret))) } diff --git a/rust/src/bin/fatcatd.rs b/rust/src/bin/fatcatd.rs index 4778df9e..1e0c3e53 100644 --- a/rust/src/bin/fatcatd.rs +++ b/rust/src/bin/fatcatd.rs @@ -71,7 +71,10 @@ fn main() { } let host_port = "localhost:9411"; - info!(logger, "Starting fatcatd API server on http://{}", &host_port); + info!( + logger, + "Starting fatcatd API server on http://{}", &host_port + ); let mut chain = Chain::new(LoggerMiddleware::new(router, logger, formatter)); |