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

Added HttpRequest::url_for_map #3409

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open

Conversation

Herddex
Copy link

@Herddex Herddex commented Jun 23, 2024

PR Type

Feature

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

Added a new public method HttpRequest::url_for_map(), an alternative to HttpRequest::url_for().

Differences from HttpRequest::url_for():

  • Accepts a std::HashMap of elements by parameter names instead of an iterator over elements.
  • Delegates to ResourceDef::resource_path_from_map() instead of ResourceDef::resource_path_from_iter()

The common code between the two methods was refactored to avoid repetition.

Closes #628

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.

Support for passing in named parameters in url_for.
1 participant