mirror of
https://github.com/hickory-dns/hickory-dns.git
synced 2026-04-25 03:05:51 +03:00
[GH-ISSUE #1411] Support &String for IntoName #667
Labels
No labels
blocked
breaking-change
bug
bug:critical
bug:tests
cleanup
compliance
compliance
compliance
crate:all
crate:client
crate:native-tls
crate:proto
crate:recursor
crate:resolver
crate:resolver
crate:rustls
crate:server
crate:util
dependencies
docs
duplicate
easy
easy
enhance
enhance
enhance
feature:dns-over-https
feature:dns-over-quic
feature:dns-over-tls
feature:dnsssec
feature:global_lb
feature:mdns
feature:tsig
features:edns
has workaround
ops
perf
platform:WASM
platform:android
platform:fuchsia
platform:linux
platform:macos
platform:windows
pull-request
question
test
tools
tools
trust
unclear
wontfix
No milestone
No project
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set.
Reference
starred/hickory-dns#667
Loading…
Add table
Add a link
Reference in a new issue
No description provided.
Delete branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Originally created by @Inrin on GitHub (Mar 14, 2021).
Original GitHub issue: https://github.com/hickory-dns/hickory-dns/issues/1411
Is your feature request related to a problem? Please describe.
no
Describe the solution you'd like
Implement
IntoNameTrait for&'a StringDescribe alternatives you've considered
Just use:
as_str()or&*fooAdditional context
https://docs.rs/trust-dns-resolver/0.20.0/trust_dns_resolver/struct.Resolver.html#method.txt_lookup
implies it behaves like a
&strParameter.https://docs.rs/trust-dns-resolver/0.20.0/trust_dns_resolver/struct.AsyncResolver.html#method.txt_lookup
just mentions a string
So my first try had been to use:
&foowhere foo is aString.@bluejekyll commented on GitHub (Mar 14, 2021):
You can use this method: https://doc.rust-lang.org/alloc/string/struct.String.html#method.as_str, though, be aware,
&strwill still allocate forName. I think adding the other impl for&Stringwould be fine, butas_strshould work in the meantime, right?@Inrin commented on GitHub (Mar 14, 2021):
Yes sure!
I used
as_str()as mentioned in "Describe alternatives you've considered".This is just a "convenience" feature request ;)
@bluejekyll commented on GitHub (Mar 14, 2021):
yeah, I saw that. I was confused if that was working as expected or not. We can add that conversion if it simplifies things.
@Inrin commented on GitHub (Mar 14, 2021):
Would be nice!
Thank you!
@bluejekyll commented on GitHub (Apr 9, 2021):
Fixed in #1434