mirror of
https://github.com/fluencelabs/rust-libp2p
synced 2025-06-27 00:31:35 +00:00
More precise error passed to inject_dial_upgrade_error (#771)
* More precise error passed to inject_dial_upgrade_error * Fix concerns * Fix panic proof
This commit is contained in:
@ -28,8 +28,6 @@ pub enum UpgradeError<E> {
|
||||
Select(ProtocolChoiceError),
|
||||
/// Error during the post-negotiation handshake.
|
||||
Apply(E),
|
||||
#[doc(hidden)]
|
||||
__Nonexhaustive
|
||||
}
|
||||
|
||||
impl<E> UpgradeError<E>
|
||||
@ -49,7 +47,6 @@ impl<E> UpgradeError<E> {
|
||||
match self {
|
||||
UpgradeError::Select(e) => UpgradeError::Select(e),
|
||||
UpgradeError::Apply(e) => UpgradeError::Apply(f(e)),
|
||||
UpgradeError::__Nonexhaustive => UpgradeError::__Nonexhaustive
|
||||
}
|
||||
}
|
||||
|
||||
@ -69,7 +66,6 @@ where
|
||||
match self {
|
||||
UpgradeError::Select(e) => write!(f, "select error: {}", e),
|
||||
UpgradeError::Apply(e) => write!(f, "upgrade apply error: {}", e),
|
||||
UpgradeError::__Nonexhaustive => f.write_str("__Nonexhaustive")
|
||||
}
|
||||
}
|
||||
}
|
||||
@ -82,7 +78,6 @@ where
|
||||
match self {
|
||||
UpgradeError::Select(e) => Some(e),
|
||||
UpgradeError::Apply(e) => Some(e),
|
||||
UpgradeError::__Nonexhaustive => None
|
||||
}
|
||||
}
|
||||
}
|
||||
|
Reference in New Issue
Block a user