Skip to content

Commit

Permalink
Change blocking Dns::get_host_by_address back to mutable self, to ali…
Browse files Browse the repository at this point in the history
…gn with Dns::get_host_by_name
  • Loading branch information
MathiasKoch committed Dec 5, 2023
1 parent 5c41b3a commit ac92f77
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions src/dns.rs
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,7 @@ pub trait Dns {
/// buffer to guarantee it'll always be large enough.
///
/// [`rfc1035`]: https://tools.ietf.org/html/rfc1035
fn get_host_by_address(&self, addr: IpAddr, result: &mut [u8]) -> Result<usize, Self::Error>;
fn get_host_by_address(&mut self, addr: IpAddr, result: &mut [u8]) -> Result<usize, Self::Error>;
}

impl<T: Dns> Dns for &mut T {
Expand All @@ -61,7 +61,7 @@ impl<T: Dns> Dns for &mut T {
T::get_host_by_name(self, hostname, addr_type)
}

fn get_host_by_address(&self, addr: IpAddr, result: &mut [u8]) -> Result<usize, Self::Error> {
fn get_host_by_address(&mut self, addr: IpAddr, result: &mut [u8]) -> Result<usize, Self::Error> {
T::get_host_by_address(self, addr, result)
}
}

0 comments on commit ac92f77

Please sign in to comment.