Skip to content

Commit

Permalink
fix: missing updates after libp2p version dump
Browse files Browse the repository at this point in the history
  • Loading branch information
BastienFaivre committed Jan 29, 2025
1 parent 424ace8 commit 4f572ca
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 5 deletions.
2 changes: 1 addition & 1 deletion dog/src/handler.rs
Original file line number Diff line number Diff line change
Expand Up @@ -413,7 +413,7 @@ impl ConnectionHandler for Handler {
ConnectionEvent::DialUpgradeError(DialUpgradeError {
error: StreamUpgradeError::Apply(e),
..
}) => void::unreachable(e),
}) => libp2p_core::util::unreachable(e),
ConnectionEvent::DialUpgradeError(DialUpgradeError {
error: StreamUpgradeError::NegotiationFailed,
..
Expand Down
7 changes: 3 additions & 4 deletions dog/src/protocol.rs
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
use std::{future::Future, iter, pin::Pin};
use std::{convert::Infallible, future::Future, iter, pin::Pin};

use asynchronous_codec::{Decoder, Encoder, Framed};
use futures::future;
Expand All @@ -9,7 +9,6 @@ use libp2p::{
InboundUpgrade, OutboundUpgrade, PeerId, StreamProtocol,
};
use quick_protobuf::Writer;
use void::Void;

use crate::{
config::ValidationMode,
Expand Down Expand Up @@ -59,7 +58,7 @@ where
TSocket: AsyncRead + AsyncWrite + Send + Unpin + 'static,
{
type Output = Framed<TSocket, DogCodec>;
type Error = Void; // TODO: change to Infallible with next rust-libp2p release
type Error = Infallible;
type Future = Pin<Box<dyn Future<Output = Result<Self::Output, Self::Error>> + Send>>;

fn upgrade_inbound(self, socket: TSocket, _: Self::Info) -> Self::Future {
Expand All @@ -75,7 +74,7 @@ where
TSocket: AsyncRead + AsyncWrite + Send + Unpin + 'static,
{
type Output = Framed<TSocket, DogCodec>;
type Error = Void; // TODO: change to Infallible with next rust-libp2p release
type Error = Infallible;
type Future = Pin<Box<dyn Future<Output = Result<Self::Output, Self::Error>> + Send>>;

fn upgrade_outbound(self, socket: TSocket, _: Self::Info) -> Self::Future {
Expand Down

0 comments on commit 4f572ca

Please sign in to comment.