Stack allocated PeerId (#1874)

* Stack allocate PeerId.

* Update stuff.

* Upgrade rusttls to fix build.

* Remove unnecessary manual implementations.

* Remove PeerId::into_bytes.

* Remove bytes dependency.

* Perform some cleanup.

* Use Into<kbucket::Key<K>>.

* Update versions and changelogs.

* Fix PR link.

* Fix benchmarks.

Co-authored-by: Roman S. Borschel <roman@parity.io>
This commit is contained in:
David Craven
2020-12-15 14:40:39 +01:00
committed by GitHub
parent a26f6aa674
commit 23b0aa016f
60 changed files with 252 additions and 223 deletions

View File

@ -139,7 +139,7 @@ impl Default for GossipsubConfig {
let mut source_string = if let Some(peer_id) = message.source.as_ref() {
peer_id.to_base58()
} else {
PeerId::from_bytes(vec![0, 1, 0])
PeerId::from_bytes(&[0, 1, 0])
.expect("Valid peer id")
.to_base58()
};