(self)
| 23 | |
| 24 | impl<T> Response<T> { |
| 25 | pub fn into_result(self) -> Result<T> { |
| 26 | match self { |
| 27 | Response::Data(data) => Ok(data), |
| 28 | Response::Error(e) => Err(anyhow!(e)), |
| 29 | } |
| 30 | } |
| 31 | } |
| 32 | |
| 33 | fn to_json<T: Serialize>(r: Result<T>) -> Json<Response<T>> { |