diff --git a/swarm/src/connection.rs b/swarm/src/connection.rs index a840ab75204..7738ecd0c87 100644 --- a/swarm/src/connection.rs +++ b/swarm/src/connection.rs @@ -745,6 +745,8 @@ enum Shutdown { Later(Delay), } +// Instead of allocating new string from `T::as_ref()` we wrap in in zero cost struct that +// allows us to use the `T: AsRef` as a key in hashmap pub(crate) struct AsStrHashEq(pub(crate) T); impl> Eq for AsStrHashEq {}