Turn some unreachable to unimplemented

They have become reachable after dropping some variants' support.
This commit is contained in:
Ivan Boldyrev 2023-08-10 13:23:46 +04:00
parent 9a006f1f35
commit 08b1879de9
2 changed files with 2 additions and 2 deletions

View File

@ -187,7 +187,7 @@ impl From<libp2p_identity::Keypair> for KeyPair {
let raw_kp = ed25519::Keypair::decode(&mut kp.to_bytes())?; let raw_kp = ed25519::Keypair::decode(&mut kp.to_bytes())?;
Ok(KeyPair::Ed25519(raw_kp)) Ok(KeyPair::Ed25519(raw_kp))
} }
_ => unreachable!(), _ => unimplemented!("key type not supported: {:?}", key.key_type()),
} }
} }

View File

@ -103,7 +103,7 @@ impl From<libp2p_identity::PublicKey> for PublicKey {
let raw_pk = ed25519::PublicKey::decode(&pk.to_bytes())?; let raw_pk = ed25519::PublicKey::decode(&pk.to_bytes())?;
Ok(PublicKey::Ed25519(raw_pk)) Ok(PublicKey::Ed25519(raw_pk))
} }
_ => unreachable!(), _ => unimplemented!("key not supported: {:?}", key.key_type()),
} }
} }