Skip to content

Commit 2ad0b03

Browse files
authored
Merge pull request #100 from rust-embedded-community/fix/dns-mut-self
Change blocking Dns::get_host_by_address back to mutable self
2 parents 5c41b3a + b50cd31 commit 2ad0b03

File tree

1 file changed

+10
-2
lines changed

1 file changed

+10
-2
lines changed

src/dns.rs

Lines changed: 10 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -47,7 +47,11 @@ pub trait Dns {
4747
/// buffer to guarantee it'll always be large enough.
4848
///
4949
/// [`rfc1035`]: https://tools.ietf.org/html/rfc1035
50-
fn get_host_by_address(&self, addr: IpAddr, result: &mut [u8]) -> Result<usize, Self::Error>;
50+
fn get_host_by_address(
51+
&mut self,
52+
addr: IpAddr,
53+
result: &mut [u8],
54+
) -> nb::Result<usize, Self::Error>;
5155
}
5256

5357
impl<T: Dns> Dns for &mut T {
@@ -61,7 +65,11 @@ impl<T: Dns> Dns for &mut T {
6165
T::get_host_by_name(self, hostname, addr_type)
6266
}
6367

64-
fn get_host_by_address(&self, addr: IpAddr, result: &mut [u8]) -> Result<usize, Self::Error> {
68+
fn get_host_by_address(
69+
&mut self,
70+
addr: IpAddr,
71+
result: &mut [u8],
72+
) -> nb::Result<usize, Self::Error> {
6573
T::get_host_by_address(self, addr, result)
6674
}
6775
}

0 commit comments

Comments
 (0)