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

Add back the typed representation of the Link header #113

Open
wants to merge 14 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,7 @@ bytes = "1"
mime = "0.3.14"
sha1 = "0.10"
httpdate = "1"
language-tags = "0.3.2"
Copy link
Member

Choose a reason for hiding this comment

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

I've tried scrolling through to find the answer, but failed so far. We don't expose this dependency, right?

Copy link
Contributor Author

@jplatte jplatte Feb 27, 2023

Choose a reason for hiding this comment

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

We are, actually. LinkValue::href_lang returns Option<&[LanguageTag]>, and LinkValue::push_href_lang has the parameter language_tag: LanguageTag.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

So you want that to change before merging?

Copy link
Member

Choose a reason for hiding this comment

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

I'd rather not expose this dependency publicly, at least that's my default feeling.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Personally I feel like it shouldn't be such a big deal for headers, as opposed to headers-core. But I'll look into how complex it would be to remove it from public API / what the consequences would be exactly.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

So the main reason I would like to not change the code here is that it allows push_href_lang to be infallible. If language-tags was required to be removed from public API, that would mean parsing the language tag provided by the user in that function. Please let me know whether you agree or not and I'll update the PR accordingly.


[features]
nightly = []
Loading