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

Allow a path as a guard in route handler macro #2771

Merged
merged 2 commits into from Jun 6, 2022

Conversation

jayong93
Copy link
Contributor

@jayong93 jayong93 commented Jun 1, 2022

PR Type

Bug Fix

PR Checklist

  • Tests for the changes have been added / updated.
  • Documentation comments have been added / updated.
  • A changelog entry has been made for the appropriate packages.
  • Format code with the latest stable rustfmt.
  • (Team) Label with affected crates and semver status.

Overview

actix-web document says route handler macros(#[get], #[post], etc.) accept any valid expression as a guard. But currently it doesn't.

This PR fixes the behavior as the doc says.

Closes #2706

@robjtede robjtede requested a review from a team June 1, 2022 14:18
@robjtede robjtede added A-codegen project: actix-web-codegen B-semver-patch labels Jun 1, 2022
@robjtede robjtede added this to the actix-web v4.1 milestone Jun 1, 2022
Copy link
Member

@JohnTitor JohnTitor left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM 👍

@JohnTitor
Copy link
Member

(CI failure is unrelated, painful dependency MSRV breaking...)

@robjtede robjtede merged commit 8e76a1c into actix:master Jun 6, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
A-codegen project: actix-web-codegen B-semver-patch
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Incorrect Documentation For Guard Functions On Attribute Macros
3 participants