Skip to content

Commit c845074

Browse files
committed
removing handlers.rs file (leftover). Adding result.rs (i forgot to push it - it should solve compilation error on CI). By the way on global cargo fmt i correctly formatted public_traffic.rs file
1 parent ad13f52 commit c845074

File tree

2 files changed

+15
-57
lines changed

2 files changed

+15
-57
lines changed

src/vit-testing/db-sync-explorer/src/rest/v0/handlers.rs

Lines changed: 0 additions & 57 deletions
This file was deleted.
Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
use super::errors::HandleError;
2+
use serde::Serialize;
3+
use warp::reply::Response;
4+
use warp::Reply;
5+
6+
pub struct HandlerResult<T>(pub Result<T, HandleError>);
7+
8+
impl<T: Send + Serialize> Reply for HandlerResult<T> {
9+
fn into_response(self) -> Response {
10+
match self.0 {
11+
Ok(res) => warp::reply::json(&res).into_response(),
12+
Err(error) => error.into_response(),
13+
}
14+
}
15+
}

0 commit comments

Comments
 (0)