Skip to content
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

refactor: Convert misc actix-web frontend calls to async await #562

Merged

Conversation

Emmanuel-Melon
Copy link
Contributor

Description

Convert actix-web front-end calls from Futures style into async/await style.

Testing

How should reviewers test?
This patch doesn't change any behavior and running cargo test should pass all tests.

Issue(s)

#541, #439
Closes #541.

@Emmanuel-Melon Emmanuel-Melon force-pushed the actix-web-frontend-async branch 2 times, most recently from 81eea37 to 1473d80 Compare April 2, 2020 00:04
@Emmanuel-Melon Emmanuel-Melon marked this pull request as ready for review April 3, 2020 19:24
@tublitzed tublitzed requested a review from a team April 6, 2020 14:56
@fzzzy
Copy link
Contributor

fzzzy commented Apr 9, 2020

@Emmanuel-Melon This looks good. Can you please run cargo fmt on the branch and commit and push the result.

@Emmanuel-Melon
Copy link
Contributor Author

Emmanuel-Melon commented Apr 9, 2020

@Emmanuel-Melon This looks good. Can you please run cargo fmt on the branch and commit and push the result.

Just did, The CI is still failing. I'll try digging into the source of error and probably squash these commits afterwards.

It's a clippy lint warning that complains about an unnecessary let binding yet omitting it makes the result value undefined.

This error can possibly be fixed by disabling this lint.

@fzzzy
Copy link
Contributor

fzzzy commented Apr 10, 2020

Change the code that the lint is complaining about to this:

Ok(HttpResponse::Ok().json(meta.db.delete_storage(meta.user_id).await?))

Can you also squash this? Looking good now.

@Emmanuel-Melon
Copy link
Contributor Author

Change the code that the lint is complaining about to this:

Ok(HttpResponse::Ok().json(meta.db.delete_storage(meta.user_id).await?))

Can you also squash this? Looking good now.

Thank you, it worked! I'll now squash and then push.

Convert actix-web front-end calls from Futures style into async/await style for more readibility. This refactor doesn't change any behavior.

Closes mozilla-services#541

refactor: convert actix-web front-end calls to async

Add missing async keyword to function definition of `test_error`.

Closes mozilla-services#541

fix: change return type for test_error

Change return type for test_error.

Closes mozilla-services#541

Convert misc actix-web frontend calls to async await

Run cargo fmt.

Closes mozilla-services#541

refactor: convert actix-web front-end calls to async

Refactor return type of delete_all() and omit `let` binding to silence clippy warnings.

Closes mozilla-services#541
@Emmanuel-Melon Emmanuel-Melon changed the title Convert misc actix-web frontend calls to async await refactor: Convert misc actix-web frontend calls to async await Apr 12, 2020
@fzzzy fzzzy merged commit d6de6cd into mozilla-services:master Apr 15, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Convert misc actix-web frontend calls to async await
2 participants