mirror of
https://github.com/fluencelabs/rust-libp2p
synced 2025-06-12 09:31:20 +00:00
Chore/semi colons (#799)
* Add helpers for easier Transports creation (#777) * Add helpers for easier Transports creation * Fix doctests * Fix ' ;' occurrences
This commit is contained in:
committed by
Toralf Wittner
parent
83320e0347
commit
f541df391a
@ -184,9 +184,9 @@ where TMuxer: muxing::StreamMuxer + Send + Sync + 'static,
|
||||
// Here is a tricky part: we need to get back the muxer in order to return
|
||||
// it, but it is in an `Arc`.
|
||||
let unwrapped = Arc::try_unwrap(muxer).unwrap_or_else(|_| {
|
||||
panic!("we clone the Arc only to put it into substreams ; once in the \
|
||||
Finishing state, no substream or upgrade exists anymore ; \
|
||||
therefore there exists only one instance of the Arc; QED")
|
||||
panic!("We clone the Arc only to put it into substreams. Once in the \
|
||||
Finishing state, no substream or upgrade exists anymore. \
|
||||
Therefore, there exists only one instance of the Arc. QED")
|
||||
});
|
||||
|
||||
// We leave `Poisoned` as the state when returning.
|
||||
|
@ -107,7 +107,7 @@ where
|
||||
}
|
||||
EitherOutput::First(sender) => {
|
||||
let observed = self.observed_addresses.get(&peer_id)
|
||||
.expect("We only receive events from nodes we're connected to ; we insert \
|
||||
.expect("We only receive events from nodes we're connected to. We insert \
|
||||
into the hashmap when we connect to a node and remove only when we \
|
||||
disconnect; QED");
|
||||
self.to_answer.push((sender, observed.clone()));
|
||||
|
@ -479,7 +479,7 @@ where
|
||||
let (query, purpose, provider_peers) = self
|
||||
.active_queries
|
||||
.remove(&finished_query)
|
||||
.expect("finished_query was gathered when iterating active_queries ; qed");
|
||||
.expect("finished_query was gathered when iterating active_queries; QED.");
|
||||
match purpose {
|
||||
QueryPurpose::Initialization => {},
|
||||
QueryPurpose::UserRequest => {
|
||||
|
@ -745,8 +745,8 @@ fn process_kad_request<TUserData>(
|
||||
) -> Result<KademliaHandlerEvent<TUserData>, io::Error> {
|
||||
match event {
|
||||
KadRequestMsg::Ping => {
|
||||
// TODO: implement ; in practice the PING message is never used, so we may consider
|
||||
// removing it altogether
|
||||
// TODO: implement; although in practice the PING message is never
|
||||
// used, so we may consider removing it altogether
|
||||
Err(io::Error::new(
|
||||
io::ErrorKind::InvalidData,
|
||||
"the PING Kademlia message is not implemented",
|
||||
|
@ -92,8 +92,8 @@ enum QueryStage {
|
||||
Iterating {
|
||||
/// Number of successful query results in a row that didn't find any closer node.
|
||||
// TODO: this is not great, because we don't necessarily receive responses in the order
|
||||
// we made the queries ; it is possible that we query multiple far-away nodes in a
|
||||
// row, and obtain results before the result of the closest nodes
|
||||
// we made the queries. It is possible that we query multiple far-away nodes in a
|
||||
// row, and obtain results before the result of the closest nodes.
|
||||
no_closer_in_a_row: usize,
|
||||
},
|
||||
|
||||
@ -268,7 +268,7 @@ impl QueryState {
|
||||
_ => (),
|
||||
};
|
||||
|
||||
// We have enough results ; the query is done.
|
||||
// We have enough results; the query is done.
|
||||
if succeeded_counter
|
||||
.as_ref()
|
||||
.map(|&c| c >= num_results)
|
||||
|
@ -238,7 +238,7 @@ where TSocket: AsyncRead + AsyncWrite
|
||||
PingListenerState::Listening => {
|
||||
match self.inner.poll() {
|
||||
Ok(Async::Ready(Some(payload))) => {
|
||||
debug!("Received ping (payload={:?}) ; sending back", payload);
|
||||
debug!("Received ping (payload={:?}); sending back", payload);
|
||||
self.state = PingListenerState::Sending(payload.freeze())
|
||||
},
|
||||
Ok(Async::Ready(None)) => self.state = PingListenerState::Closing,
|
||||
|
Reference in New Issue
Block a user