Skip to content

Commit

Permalink
Fix codeliness
Browse files Browse the repository at this point in the history
  • Loading branch information
hainesc committed Apr 22, 2024
1 parent 8218469 commit 12956a4
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 4 deletions.
6 changes: 3 additions & 3 deletions crates/proto/src/udp/udp_client_stream.rs
Expand Up @@ -36,7 +36,7 @@ where
MF: MessageFinalizer,
{
name_server: SocketAddr,
bind_server: Option<SocketAddr>,
bind_addr: Option<SocketAddr>,
timeout: Duration,
is_shutdown: bool,
signer: Option<Arc<MF>>,
Expand Down Expand Up @@ -238,7 +238,7 @@ impl<S: DnsUdpSocket + Send + 'static, MF: MessageFinalizer> DnsRequestSender
);
let creator = self.creator.clone();
let addr = message.addr();
let bind_addr = self.bind_server.clone();
let bind_addr = self.bind_addr;

S::Time::timeout::<Pin<Box<dyn Future<Output = Result<DnsResponse, ProtoError>> + Send>>>(
self.timeout,
Expand Down Expand Up @@ -297,7 +297,7 @@ impl<S: Send + Unpin, MF: MessageFinalizer> Future for UdpClientConnect<S, MF> {
// TODO: this doesn't need to be a future?
Poll::Ready(Ok(UdpClientStream::<S, MF> {
name_server: self.name_server,
bind_server: self.bind_addr,
bind_addr: self.bind_addr,
is_shutdown: false,
timeout: self.timeout,
signer: self.signer.take(),
Expand Down
3 changes: 2 additions & 1 deletion crates/proto/src/udp/udp_stream.rs
Expand Up @@ -264,8 +264,9 @@ impl<S: UdpSocket + 'static> NextRandomUdpSocket<S> {

impl<S: DnsUdpSocket> NextRandomUdpSocket<S> {
/// Create a future with generator
#[allow(dead_code)]
pub(crate) fn new_with_closure(name_server: &SocketAddr, func: UdpCreator<S>) -> Self {
NextRandomUdpSocket::<S>::new_with_bind_addr_and_closure(name_server, &None, func)
Self::new_with_bind_addr_and_closure(name_server, &None, func)
}

/// Create a future with generator
Expand Down

0 comments on commit 12956a4

Please sign in to comment.