-
Notifications
You must be signed in to change notification settings - Fork 12.8k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
^^^^^^^ expected ()
, found Result<ServiceResponse<B>, _>
??? not related not informative ..
#115405
Comments
An if [Method::POST, Method::GET, Method::HEAD].contains(req.method()) && req.path() == "/ping" {
Ok(res)
}
else {
Err(actix_web::error::ErrorImATeapot("Tea"))
} See |
@ShE3py did you test it ? i guess not ,
|
You either need to write |
@Taaitaaiger not working in this case of actix_web |
I don't quite understand? if (Method::POST == req.method() ||
Method::GET == req.method() ||
Method::HEAD == req.method()) && req.path() == "/ping" {
Ok(res)
} else {
Err(actix_web::error::ErrorImATeapot("Tea"))
} solves the error you posted, however this uncovers a new error due to you using a value after move. |
@compiler-errors this is the issue I was mentioning just now. Returning the |
When encountering a tail expression in the then arm of an `if` expression without an `else` arm, account for `async fn` and `async` blocks to suggest `return`ing the value and pointing at the return type of the `async fn`. We now also account for AFIT when looking for the return type to point at. Fix rust-lang#115405.
When encountering a tail expression in the then arm of an `if` expression without an `else` arm, account for `async fn` and `async` blocks to suggest `return`ing the value and pointing at the return type of the `async fn`. We now also account for AFIT when looking for the return type to point at. Fix rust-lang#115405.
When encountering a tail expression in the then arm of an `if` expression without an `else` arm, account for `async fn` and `async` blocks to suggest `return`ing the value and pointing at the return type of the `async fn`. We now also account for AFIT when looking for the return type to point at. Fix rust-lang#115405.
Properly handle `async` block and `async fn` in `if` exprs without `else` When encountering a tail expression in the then arm of an `if` expression without an `else` arm, account for `async fn` and `async` blocks to suggest `return`ing the value and pointing at the return type of the `async fn`. We now also account for AFIT when looking for the return type to point at. Fix rust-lang#115405.
Rollup merge of rust-lang#120696 - estebank:issue-115405, r=oli-obk Properly handle `async` block and `async fn` in `if` exprs without `else` When encountering a tail expression in the then arm of an `if` expression without an `else` arm, account for `async fn` and `async` blocks to suggest `return`ing the value and pointing at the return type of the `async fn`. We now also account for AFIT when looking for the return type to point at. Fix rust-lang#115405.
Code
Current output
Desired output
Rationale and extra context
using letest actix-web
Other cases
No response
Anything else?
No response
The text was updated successfully, but these errors were encountered: