Skip to content

Commit

Permalink
feat(dns): add Default impl for Config
Browse files Browse the repository at this point in the history
  • Loading branch information
fujiapple852 committed Jun 18, 2024
1 parent f972dd6 commit e5ad7ab
Showing 1 changed file with 10 additions and 0 deletions.
10 changes: 10 additions & 0 deletions crates/trippy-dns/src/lazy_resolver.rs
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,16 @@ pub struct Config {
pub timeout: Duration,
}

impl Default for Config {
fn default() -> Self {
Self {
resolve_method: ResolveMethod::System,
addr_family: IpAddrFamily::Ipv4thenIpv6,
timeout: Duration::from_millis(5000),
}
}
}

/// How DNS queries will be resolved.
#[derive(Debug, Copy, Clone, Eq, PartialEq)]
pub enum ResolveMethod {
Expand Down

0 comments on commit e5ad7ab

Please sign in to comment.