We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent e725bca commit d85bf58Copy full SHA for d85bf58
examples/dyn_reply.rs
@@ -3,10 +3,9 @@ use warp::{http::StatusCode, Filter};
3
4
async fn dyn_reply(word: String) -> Result<Box<dyn warp::Reply>, warp::Rejection> {
5
if &word == "hello" {
6
- // a cast is needed for now, see https://github.com/rust-lang/rust/issues/60424
7
- Ok(Box::new("world") as Box<dyn warp::Reply>)
+ Ok(Box::new("world"))
8
} else {
9
- Ok(Box::new(StatusCode::BAD_REQUEST) as Box<dyn warp::Reply>)
+ Ok(Box::new(StatusCode::BAD_REQUEST))
10
}
11
12
0 commit comments