http-rs / http-rs/tide

Endpoint Trait misbehaving in 0.7

Open
#444 2 comments 0 reactions 0 assignees View on GitHub
Dominant language
Rust
Stars
5.1k
Forks
329
PR merge metrics
No merged PRs in 30d

Description

I updated from 0.6 to 0.7 and none of the endpoints are working any more with an extremely strange compilation error:
```
--> tremor-server/src/main.rs:202:24
|
202 | app.at("/version").get(api::version::get);
| ^^^ expected enum `tremor_api::api::Error`, found struct `http_types::error::Error`
|
= note: expected enum `std::result::Result`
found enum `std::result::Result<_, http_types::error::Error>`
= note: required because of the requirements on the impl of `tide::endpoint::Endpoint` for `fn(tide::request::Request) -> impl std::future::Future {tremor_api::api::version::get}`
```

Now this wouldn't be so strange if not the implementation for `api::version::get` would be (where `crate` == `api`):

```rust
pub async fn get(req: Request) -> std::result::Result {
reply(req, Version::default(), false, StatusCode::Ok).await
}
```

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.