mirror of
https://github.com/fluencelabs/rust-libp2p
synced 2025-06-15 02:51:25 +00:00
Chore/grammar (#701)
* Add a space. * qed -> QED and ' ; qed' -> '; QED' * ' ; QED' -> '; QED'
This commit is contained in:
committed by
Pierre Krieger
parent
3aa1fcbdc6
commit
fceaf2293b
@ -197,7 +197,7 @@ impl<'a, TInEvent, TOutEvent, THandler> CollectionReachEvent<'a, TInEvent, TOutE
|
|||||||
self.parent.inner.task(former_task_id)
|
self.parent.inner.task(former_task_id)
|
||||||
.expect("whenever we receive a TaskClosed event or close a node, we remove the \
|
.expect("whenever we receive a TaskClosed event or close a node, we remove the \
|
||||||
corresponding entry from self.nodes; therefore all elements in \
|
corresponding entry from self.nodes; therefore all elements in \
|
||||||
self.nodes are valid tasks in the HandledNodesTasks; qed")
|
self.nodes are valid tasks in the HandledNodesTasks; QED")
|
||||||
.close();
|
.close();
|
||||||
let _former_other_state = self.parent.tasks.remove(&former_task_id);
|
let _former_other_state = self.parent.tasks.remove(&former_task_id);
|
||||||
debug_assert_eq!(_former_other_state, Some(TaskState::Connected(self.peer_id.clone())));
|
debug_assert_eq!(_former_other_state, Some(TaskState::Connected(self.peer_id.clone())));
|
||||||
@ -244,7 +244,7 @@ impl<'a, TInEvent, TOutEvent, THandler> Drop for CollectionReachEvent<'a, TInEve
|
|||||||
.expect("we create the CollectionReachEvent with a valid task id; the \
|
.expect("we create the CollectionReachEvent with a valid task id; the \
|
||||||
CollectionReachEvent mutably borrows the collection, therefore nothing \
|
CollectionReachEvent mutably borrows the collection, therefore nothing \
|
||||||
can delete this task during the lifetime of the CollectionReachEvent; \
|
can delete this task during the lifetime of the CollectionReachEvent; \
|
||||||
therefore the task is still valid when we delete it; qed")
|
therefore the task is still valid when we delete it; QED")
|
||||||
.close();
|
.close();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -311,7 +311,7 @@ impl<TInEvent, TOutEvent, THandler> CollectionStream<TInEvent, TOutEvent, THandl
|
|||||||
.expect("whenever we receive a TaskClosed event or interrupt a task, we \
|
.expect("whenever we receive a TaskClosed event or interrupt a task, we \
|
||||||
remove the corresponding entry from self.tasks; therefore all \
|
remove the corresponding entry from self.tasks; therefore all \
|
||||||
elements in self.tasks are valid tasks in the \
|
elements in self.tasks are valid tasks in the \
|
||||||
HandledNodesTasks; qed")
|
HandledNodesTasks; QED")
|
||||||
.close();
|
.close();
|
||||||
|
|
||||||
Ok(())
|
Ok(())
|
||||||
@ -410,7 +410,7 @@ impl<TInEvent, TOutEvent, THandler> CollectionStream<TInEvent, TOutEvent, THandl
|
|||||||
panic!("self.tasks is always kept in sync with the tasks in self.inner; \
|
panic!("self.tasks is always kept in sync with the tasks in self.inner; \
|
||||||
when we add a task in self.inner we add a corresponding entry in \
|
when we add a task in self.inner we add a corresponding entry in \
|
||||||
self.tasks, and remove the entry only when the task is closed; \
|
self.tasks, and remove the entry only when the task is closed; \
|
||||||
qed")
|
QED")
|
||||||
},
|
},
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
@ -427,7 +427,7 @@ impl<TInEvent, TOutEvent, THandler> CollectionStream<TInEvent, TOutEvent, THandl
|
|||||||
_ => panic!("we can only receive NodeEvent events from a task after we \
|
_ => panic!("we can only receive NodeEvent events from a task after we \
|
||||||
received a corresponding NodeReached event from that same task; \
|
received a corresponding NodeReached event from that same task; \
|
||||||
when we receive a NodeReached event, we ensure that the entry in \
|
when we receive a NodeReached event, we ensure that the entry in \
|
||||||
self.tasks is switched to the Connected state; qed"),
|
self.tasks is switched to the Connected state; QED"),
|
||||||
};
|
};
|
||||||
|
|
||||||
Async::Ready(CollectionEvent::NodeEvent {
|
Async::Ready(CollectionEvent::NodeEvent {
|
||||||
@ -463,7 +463,7 @@ impl<'a, TInEvent> PeerMut<'a, TInEvent> {
|
|||||||
debug_assert_eq!(old_task_id, Some(self.inner.id()));
|
debug_assert_eq!(old_task_id, Some(self.inner.id()));
|
||||||
} else {
|
} else {
|
||||||
panic!("a PeerMut can only be created if an entry is present in nodes; an entry in \
|
panic!("a PeerMut can only be created if an entry is present in nodes; an entry in \
|
||||||
nodes always matched a Connected entry in tasks; qed");
|
nodes always matched a Connected entry in tasks; QED");
|
||||||
};
|
};
|
||||||
|
|
||||||
self.inner.close();
|
self.inner.close();
|
||||||
|
@ -660,7 +660,7 @@ mod tests {
|
|||||||
// Async::Ready(None) triggers a shutdown of the Handler so that it
|
// Async::Ready(None) triggers a shutdown of the Handler so that it
|
||||||
// also yields Async::Ready(None). Finally, the NodeTask gets a
|
// also yields Async::Ready(None). Finally, the NodeTask gets a
|
||||||
// Async::Ready(None) and sends a TaskClosed and returns
|
// Async::Ready(None) and sends a TaskClosed and returns
|
||||||
// Async::Ready(()). Qed.
|
// Async::Ready(()). QED.
|
||||||
|
|
||||||
let create_outbound_substream_event = InEvent::Substream(Some(135));
|
let create_outbound_substream_event = InEvent::Substream(Some(135));
|
||||||
tx.unbounded_send(create_outbound_substream_event).expect("send msg works");
|
tx.unbounded_send(create_outbound_substream_event).expect("send msg works");
|
||||||
|
@ -657,7 +657,7 @@ where
|
|||||||
opened and remove only when a connection is closed; the \
|
opened and remove only when a connection is closed; the \
|
||||||
underlying API is guaranteed to always deliver a connection \
|
underlying API is guaranteed to always deliver a connection \
|
||||||
closed message after it has been opened, and no two closed \
|
closed message after it has been opened, and no two closed \
|
||||||
messages; qed");
|
messages; QED");
|
||||||
debug_assert!(!self.reach_attempts.out_reach_attempts.contains_key(&peer_id));
|
debug_assert!(!self.reach_attempts.out_reach_attempts.contains_key(&peer_id));
|
||||||
action = Default::default();
|
action = Default::default();
|
||||||
out_event = RawSwarmEvent::NodeError {
|
out_event = RawSwarmEvent::NodeError {
|
||||||
@ -672,7 +672,7 @@ where
|
|||||||
opened and remove only when a connection is closed; the \
|
opened and remove only when a connection is closed; the \
|
||||||
underlying API is guaranteed to always deliver a connection \
|
underlying API is guaranteed to always deliver a connection \
|
||||||
closed message after it has been opened, and no two closed \
|
closed message after it has been opened, and no two closed \
|
||||||
messages; qed");
|
messages; QED");
|
||||||
debug_assert!(!self.reach_attempts.out_reach_attempts.contains_key(&peer_id));
|
debug_assert!(!self.reach_attempts.out_reach_attempts.contains_key(&peer_id));
|
||||||
action = Default::default();
|
action = Default::default();
|
||||||
out_event = RawSwarmEvent::NodeClosed { peer_id, endpoint };
|
out_event = RawSwarmEvent::NodeClosed { peer_id, endpoint };
|
||||||
@ -696,7 +696,7 @@ where
|
|||||||
active_nodes.add_reach_attempt, and we remove only when we call \
|
active_nodes.add_reach_attempt, and we remove only when we call \
|
||||||
interrupt or when a reach attempt succeeds or errors; therefore the \
|
interrupt or when a reach attempt succeeds or errors; therefore the \
|
||||||
out_reach_attempts should always be in sync with the actual \
|
out_reach_attempts should always be in sync with the actual \
|
||||||
attempts; qed");
|
attempts; QED");
|
||||||
}
|
}
|
||||||
|
|
||||||
return Async::Ready(out_event);
|
return Async::Ready(out_event);
|
||||||
@ -770,7 +770,7 @@ where
|
|||||||
.expect("We insert into connected_points whenever a connection is opened and \
|
.expect("We insert into connected_points whenever a connection is opened and \
|
||||||
remove only when a connection is closed; the underlying API is \
|
remove only when a connection is closed; the underlying API is \
|
||||||
guaranteed to always deliver a connection closed message after it has \
|
guaranteed to always deliver a connection closed message after it has \
|
||||||
been opened, and no two closed messages; qed");
|
been opened, and no two closed messages; QED");
|
||||||
return (action, RawSwarmEvent::Replaced {
|
return (action, RawSwarmEvent::Replaced {
|
||||||
peer_id,
|
peer_id,
|
||||||
endpoint: opened_endpoint,
|
endpoint: opened_endpoint,
|
||||||
@ -808,7 +808,7 @@ where
|
|||||||
.expect("We insert into connected_points whenever a connection is opened and \
|
.expect("We insert into connected_points whenever a connection is opened and \
|
||||||
remove only when a connection is closed; the underlying API is guaranteed \
|
remove only when a connection is closed; the underlying API is guaranteed \
|
||||||
to always deliver a connection closed message after it has been opened, \
|
to always deliver a connection closed message after it has been opened, \
|
||||||
and no two closed messages; qed");
|
and no two closed messages; QED");
|
||||||
return (Default::default(), RawSwarmEvent::Replaced {
|
return (Default::default(), RawSwarmEvent::Replaced {
|
||||||
peer_id,
|
peer_id,
|
||||||
endpoint: opened_endpoint,
|
endpoint: opened_endpoint,
|
||||||
@ -1103,7 +1103,7 @@ impl<'a, TInEvent> PeerConnected<'a, TInEvent> {
|
|||||||
.expect("We insert into connected_points whenever a connection is opened and remove \
|
.expect("We insert into connected_points whenever a connection is opened and remove \
|
||||||
only when a connection is closed; the underlying API is guaranteed to always \
|
only when a connection is closed; the underlying API is guaranteed to always \
|
||||||
deliver a connection closed message after it has been opened, and no two \
|
deliver a connection closed message after it has been opened, and no two \
|
||||||
closed messages; qed")
|
closed messages; QED")
|
||||||
}
|
}
|
||||||
|
|
||||||
/// Sends an event to the node.
|
/// Sends an event to the node.
|
||||||
|
@ -215,7 +215,7 @@ where
|
|||||||
for subscription in event.subscriptions {
|
for subscription in event.subscriptions {
|
||||||
let mut remote_peer_topics = self.connected_peers
|
let mut remote_peer_topics = self.connected_peers
|
||||||
.get_mut(&propagation_source)
|
.get_mut(&propagation_source)
|
||||||
.expect("connected_peers is kept in sync with the peers we are connected to; we are guaranteed to only receive events from connected peers ; qed");
|
.expect("connected_peers is kept in sync with the peers we are connected to; we are guaranteed to only receive events from connected peers; QED");
|
||||||
match subscription.action {
|
match subscription.action {
|
||||||
FloodsubSubscriptionAction::Subscribe => {
|
FloodsubSubscriptionAction::Subscribe => {
|
||||||
if !remote_peer_topics.contains(&subscription.topic) {
|
if !remote_peer_topics.contains(&subscription.topic) {
|
||||||
|
@ -189,7 +189,7 @@ where TMuxer: muxing::StreamMuxer + Send + Sync + 'static,
|
|||||||
let unwrapped = Arc::try_unwrap(muxer).unwrap_or_else(|_| {
|
let unwrapped = Arc::try_unwrap(muxer).unwrap_or_else(|_| {
|
||||||
panic!("we clone the Arc only to put it into substreams ; once in the \
|
panic!("we clone the Arc only to put it into substreams ; once in the \
|
||||||
Finishing state, no substream or upgrade exists anymore ; \
|
Finishing state, no substream or upgrade exists anymore ; \
|
||||||
therefore there exists only one instance of the Arc ; qed")
|
therefore there exists only one instance of the Arc; QED")
|
||||||
});
|
});
|
||||||
|
|
||||||
// We leave `Poisoned` as the state when returning.
|
// We leave `Poisoned` as the state when returning.
|
||||||
|
@ -92,7 +92,7 @@ where
|
|||||||
) {
|
) {
|
||||||
let observed = self.observed_addresses.get(&peer_id)
|
let observed = self.observed_addresses.get(&peer_id)
|
||||||
.expect("We only receive events from nodes we're connected to ; we insert into the \
|
.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");
|
hashmap when we connect to a node and remove only when we disconnect; QED");
|
||||||
let future = sender.send(self.send_back_info.clone(), &observed);
|
let future = sender.send(self.send_back_info.clone(), &observed);
|
||||||
self.futures.push(future);
|
self.futures.push(future);
|
||||||
}
|
}
|
||||||
|
Reference in New Issue
Block a user