Skip to content

Commit d85bf58

Browse files
dvicjxs
authored andcommitted
chore: remove cast from example (#403)
The cast is not needed anymore as rust-lang/rust#60424 has been fixed.
1 parent e725bca commit d85bf58

File tree

1 file changed

+2
-3
lines changed

1 file changed

+2
-3
lines changed

examples/dyn_reply.rs

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -3,10 +3,9 @@ use warp::{http::StatusCode, Filter};
33

44
async fn dyn_reply(word: String) -> Result<Box<dyn warp::Reply>, warp::Rejection> {
55
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>)
6+
Ok(Box::new("world"))
87
} else {
9-
Ok(Box::new(StatusCode::BAD_REQUEST) as Box<dyn warp::Reply>)
8+
Ok(Box::new(StatusCode::BAD_REQUEST))
109
}
1110
}
1211

0 commit comments

Comments
 (0)