Skip to content

Commit

Permalink
version 0.5.2 (#15)
Browse files Browse the repository at this point in the history
* fix: remove misplaced must_use

* chore(deps): pin the exact version of dependencies

* fix(dns): fix dns issue on bind
  • Loading branch information
lorenzofelletti authored Jun 24, 2024
1 parent 85c5fb2 commit aad1160
Show file tree
Hide file tree
Showing 4 changed files with 5 additions and 15 deletions.
6 changes: 3 additions & 3 deletions Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -16,13 +16,13 @@ default = []
[dependencies]
psp = { version = "0.3.9" }
dns-protocol = { version = "0.1.1", default-features = false }
embedded-tls = { version = "0.17", default-features = false }
embedded-tls = { version = "0.17.0", default-features = false }
embedded-io = { version = "0.6.1", default-features = false }
rand = { version = "0.8.5", default-features = false }
rand_chacha = { version = "0.3.1", default-features = false }
regex = { version = "1.10", default-features = false }
lazy_static = { version = "1.4", default-features = false, features = [
lazy_static = { version = "1.4.0", default-features = false, features = [
"spin_no_std",
] }
embedded-nal = "0.8"
embedded-nal = "0.8.0"
bitflags = { version = "2.5.0", default-features = false }
10 changes: 2 additions & 8 deletions src/dns.rs
Original file line number Diff line number Diff line change
Expand Up @@ -59,7 +59,7 @@ impl DnsResolver {
pub fn new(dns: SocketAddr) -> Result<Self, DnsError> {
let mut udp_socket = UdpSocket::new().map_err(|_| DnsError::FailedToCreate)?;
udp_socket
.bind(Some(dns))
.bind(None) // binds to None, otherwise the socket errors for some reason
.map_err(|_| DnsError::FailedToCreate)?;

Ok(DnsResolver { udp_socket, dns })
Expand All @@ -72,13 +72,7 @@ impl DnsResolver {
/// - [`DnsError::FailedToCreate`]: The DNS resolver failed to create. This may
/// happen if the socket could not be created or bound to the specified address
pub fn try_default() -> Result<Self, DnsError> {
let dns = *GOOGLE_DNS_HOST;
let mut udp_socket = UdpSocket::new().map_err(|_| DnsError::FailedToCreate)?;
udp_socket
.bind(Some(dns))
.map_err(|_| DnsError::FailedToCreate)?;

Ok(DnsResolver { udp_socket, dns })
Self::new(*GOOGLE_DNS_HOST)
}

/// Resolve a hostname to an IP address
Expand Down
2 changes: 0 additions & 2 deletions src/socket/tcp.rs
Original file line number Diff line number Diff line change
Expand Up @@ -208,7 +208,6 @@ impl TcpSocket {
}

/// Set the flags used when sending data
#[must_use]
pub fn set_send_flags(&mut self, send_flags: SocketSendFlags) {
self.send_flags = send_flags;
}
Expand All @@ -220,7 +219,6 @@ impl TcpSocket {
}

/// Set the flags used when receiving data
#[must_use]
pub fn set_recv_flags(&mut self, recv_flags: SocketRecvFlags) {
self.recv_flags = recv_flags;
}
Expand Down
2 changes: 0 additions & 2 deletions src/socket/udp.rs
Original file line number Diff line number Diff line change
Expand Up @@ -367,7 +367,6 @@ impl UdpSocket {
}

/// Set the flags used when sending data
#[must_use]
pub fn set_send_flags(&mut self, send_flags: SocketSendFlags) {
self.send_flags = send_flags;
}
Expand All @@ -379,7 +378,6 @@ impl UdpSocket {
}

/// Set the flags used when receiving data
#[must_use]
pub fn set_recv_flags(&mut self, recv_flags: SocketRecvFlags) {
self.recv_flags = recv_flags;
}
Expand Down

0 comments on commit aad1160

Please sign in to comment.