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

Make path parameters more generic #15

Draft
wants to merge 2 commits into
base: main
Choose a base branch
from
Draft

Make path parameters more generic #15

wants to merge 2 commits into from

Conversation

fwcd
Copy link
Member

@fwcd fwcd commented Jun 1, 2024

Instead of taking &[&str], this refactors most path parameters to take impl Iterator<Item = impl AsRef<str>>. This should make it possible to pass owned containers (e.g. Vecs or arrays), including those containing owned Strings.

While this seems to be the suggested approach for passing strings generically, it significantly impairs readability and introduces some ambiguities when passing empty paths (previously &[] would have been accepted, which is now ambiguous due to the generic impl AsRef<str>).

Draft PR for now until we figure out a more acceptable tradeoff.

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.

1 participant