-
-
Notifications
You must be signed in to change notification settings - Fork 1.7k
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
Add "name" attribute to route macro #1934
Conversation
Why do you feel using the handler name is not sufficient? Doesn using raw identifiers |
Thanks for reminding me the |
actix-web-codegen/src/route.rs
Outdated
resource_name.value() | ||
} else { | ||
name.to_string() | ||
}; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Could it be a unwrap_or_else
?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
ok, changed
would be okay to move ahead with this if you can get it rebased @richardchien |
Ok, I've rebased |
@richardchien Needs conflict resolution now. ;) |
@therealprof Ok, resolved |
I can usually rebase master branch into PRs in order to coordinate the merge but you must have that option disabled. I'm sorry but I'm going to have to ask you to rebase again because another PR just got merged that fixed CI. |
@robjtede Rebased again:) |
@richardchien thanks, i shall merge this one next |
😅 there we go... thanks for you contribution @richardchien |
PR Type
Feature
PR Checklist
Overview
This PR adds a new
name
attribute to theroute
macro, so that user can specify a resource name, which by default is the name of handler function since #1178, and callHttpRequest.url_for
on the name later.Example: