mirror of
https://github.com/fluencelabs/rust-libp2p
synced 2025-06-13 01:51:23 +00:00
to/into consistency for PublicKey and PeerId (#2145)
- Change `PublicKey::into_protobuf_encoding` to `PublicKey::to_protobuf_encoding`. - Change `PublicKey::into_peer_id` to `PublicKey::to_peer_id`. - Change `PeerId::from_public_key(PublicKey)` to `PeerId::from_public_key(&PublicKey)`. - Add `From<&PublicKey> for PeerId`. Co-authored-by: Max Inden <mail@max-inden.de>
This commit is contained in:
@ -35,7 +35,7 @@
|
||||
//! #
|
||||
//! # let local_key = identity::Keypair::generate_ed25519();
|
||||
//! # let local_public_key = local_key.public();
|
||||
//! # let local_peer_id = local_public_key.clone().into_peer_id();
|
||||
//! # let local_peer_id = local_public_key.to_peer_id();
|
||||
//! # let plaintext = PlainText2Config {
|
||||
//! # local_public_key: local_public_key.clone(),
|
||||
//! # };
|
||||
|
Reference in New Issue
Block a user