Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There already exists
AsRef<str>
implementation forDNSName
, but given there is alsoas_ref() -> DNSNameRef
, trying to get a&str
withdns_name.as_ref()
ends up picking the wrong implementation.The
AsRef::<str>::as_ref(&source)
alternative works, but isn't that pretty!The
as_str()
is somewhat idiomatic solution to this (seeString::as_str()
for an example).(The
AsRef::<str>::...
is a suitable workaround, which I've already unleashed upon my codebase so I don't really need this PR to land if there's a reason to reject it.)I don't believe the changes are significant enough to be covered by copyright, but to avoid any doubt, if they were, I'd be the owner and I'll license them under the same terms as the exiting webpki code.