diff --git a/core/src/connection/pool.rs b/core/src/connection/pool.rs index 7705d441..ccb89d6f 100644 --- a/core/src/connection/pool.rs +++ b/core/src/connection/pool.rs @@ -842,7 +842,7 @@ where I: Iterator { /// Obtains the next connection, if any. - pub fn next<'b>(&'b mut self) -> Option> + pub fn next(&mut self) -> Option> { while let Some(id) = self.ids.next() { if self.pool.manager.is_established(&id) { // (*) diff --git a/core/src/network/peer.rs b/core/src/network/peer.rs index 284ef4e4..a1039334 100644 --- a/core/src/network/peer.rs +++ b/core/src/network/peer.rs @@ -432,8 +432,8 @@ where /// Obtains a dialing attempt to the peer by connection ID of /// the current connection attempt. - pub fn attempt<'b>(&'b mut self, id: ConnectionId) - -> Option> + pub fn attempt(&mut self, id: ConnectionId) + -> Option> { if let hash_map::Entry::Occupied(attempts) = self.network.dialing.entry(self.peer_id.clone()) { if let Some(pos) = attempts.get().iter().position(|s| s.current.0 == id) { @@ -446,8 +446,8 @@ where } /// Gets an iterator over all dialing (i.e. pending outgoing) connections to the peer. - pub fn attempts<'b>(&'b mut self) - -> DialingAttemptIter<'b, + pub fn attempts(&mut self) + -> DialingAttemptIter<'_, TInEvent, TOutEvent, THandler, @@ -460,8 +460,8 @@ where /// Obtains some dialing connection to the peer. /// /// At least one dialing connection is guaranteed to exist on a `DialingPeer`. - pub fn some_attempt<'b>(&'b mut self) - -> DialingAttempt<'b, TInEvent> + pub fn some_attempt(&mut self) + -> DialingAttempt<'_, TInEvent> { self.attempts() .into_first() diff --git a/misc/multiaddr/src/from_url.rs b/misc/multiaddr/src/from_url.rs index cfafbef8..fa5acfac 100644 --- a/misc/multiaddr/src/from_url.rs +++ b/misc/multiaddr/src/from_url.rs @@ -82,13 +82,13 @@ fn from_url_inner_http_ws(url: url::Url, lossy: bool) -> std::result::Result std::result::Result unreachable!("We only call this function for one of the given schemes; qed") }; - if !lossy { - if !url.username().is_empty() || url.password().is_some() || - url.query().is_some() || url.fragment().is_some() - { - return Err(FromUrlErr::InformationLoss); - } + if !lossy && ( + !url.username().is_empty() || + url.password().is_some() || + url.query().is_some() || + url.fragment().is_some() + ) { + return Err(FromUrlErr::InformationLoss); } Ok(Multiaddr::from(protocol))