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

refactor(client) use Box<str> in ..::dns::Name #2727

Merged
merged 1 commit into from
Dec 29, 2021
Merged
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
6 changes: 3 additions & 3 deletions src/client/connect/dns.rs
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@ pub(super) use self::sealed::Resolve;
/// A domain name to resolve into IP addresses.
#[derive(Clone, Hash, Eq, PartialEq)]
pub struct Name {
host: String,
host: Box<str>,
}

/// A resolver using blocking `getaddrinfo` calls in a threadpool.
Expand All @@ -58,7 +58,7 @@ pub struct GaiFuture {
}

impl Name {
pub(super) fn new(host: String) -> Name {
pub(super) fn new(host: Box<str>) -> Name {
Name { host }
}

Expand All @@ -85,7 +85,7 @@ impl FromStr for Name {

fn from_str(host: &str) -> Result<Self, Self::Err> {
// Possibly add validation later
Ok(Name::new(host.to_owned()))
Ok(Name::new(host.into()))
}
}

Expand Down