mirror of
https://github.com/fluencelabs/rust-libp2p
synced 2025-06-14 18:41:22 +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)
|
||||
.expect("whenever we receive a TaskClosed event or close a node, we remove the \
|
||||
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();
|
||||
let _former_other_state = self.parent.tasks.remove(&former_task_id);
|
||||
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 \
|
||||
CollectionReachEvent mutably borrows the collection, therefore nothing \
|
||||
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();
|
||||
}
|
||||
}
|
||||
@ -311,7 +311,7 @@ impl<TInEvent, TOutEvent, THandler> CollectionStream<TInEvent, TOutEvent, THandl
|
||||
.expect("whenever we receive a TaskClosed event or interrupt a task, we \
|
||||
remove the corresponding entry from self.tasks; therefore all \
|
||||
elements in self.tasks are valid tasks in the \
|
||||
HandledNodesTasks; qed")
|
||||
HandledNodesTasks; QED")
|
||||
.close();
|
||||
|
||||
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; \
|
||||
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; \
|
||||
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 \
|
||||
received a corresponding NodeReached event from that same task; \
|
||||
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 {
|
||||
@ -463,7 +463,7 @@ impl<'a, TInEvent> PeerMut<'a, TInEvent> {
|
||||
debug_assert_eq!(old_task_id, Some(self.inner.id()));
|
||||
} else {
|
||||
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();
|
||||
|
@ -660,7 +660,7 @@ mod tests {
|
||||
// Async::Ready(None) triggers a shutdown of the Handler so that it
|
||||
// also yields Async::Ready(None). Finally, the NodeTask gets a
|
||||
// Async::Ready(None) and sends a TaskClosed and returns
|
||||
// Async::Ready(()). Qed.
|
||||
// Async::Ready(()). QED.
|
||||
|
||||
let create_outbound_substream_event = InEvent::Substream(Some(135));
|
||||
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 \
|
||||
underlying API is guaranteed to always deliver a connection \
|
||||
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));
|
||||
action = Default::default();
|
||||
out_event = RawSwarmEvent::NodeError {
|
||||
@ -672,7 +672,7 @@ where
|
||||
opened and remove 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 closed \
|
||||
messages; qed");
|
||||
messages; QED");
|
||||
debug_assert!(!self.reach_attempts.out_reach_attempts.contains_key(&peer_id));
|
||||
action = Default::default();
|
||||
out_event = RawSwarmEvent::NodeClosed { peer_id, endpoint };
|
||||
@ -696,7 +696,7 @@ where
|
||||
active_nodes.add_reach_attempt, and we remove only when we call \
|
||||
interrupt or when a reach attempt succeeds or errors; therefore the \
|
||||
out_reach_attempts should always be in sync with the actual \
|
||||
attempts; qed");
|
||||
attempts; QED");
|
||||
}
|
||||
|
||||
return Async::Ready(out_event);
|
||||
@ -770,7 +770,7 @@ where
|
||||
.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 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 {
|
||||
peer_id,
|
||||
endpoint: opened_endpoint,
|
||||
@ -808,7 +808,7 @@ where
|
||||
.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 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 {
|
||||
peer_id,
|
||||
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 \
|
||||
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 \
|
||||
closed messages; qed")
|
||||
closed messages; QED")
|
||||
}
|
||||
|
||||
/// Sends an event to the node.
|
||||
|
@ -34,7 +34,7 @@
|
||||
//! cargo run --example chat -- /ip4/127.0.0.1/tcp/24915
|
||||
//! ```
|
||||
//! The two nodes connect. Type a message in either terminal and hit return: the
|
||||
//! message is sent and printed in the other terminal.Close with Ctrl-c.
|
||||
//! message is sent and printed in the other terminal. Close with Ctrl-c.
|
||||
//!
|
||||
//! You can of course open more terminal windows and add more participants.
|
||||
//! Dialing any of the other peers will propagate the new participant to all
|
||||
|
@ -215,7 +215,7 @@ where
|
||||
for subscription in event.subscriptions {
|
||||
let mut remote_peer_topics = self.connected_peers
|
||||
.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 {
|
||||
FloodsubSubscriptionAction::Subscribe => {
|
||||
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(|_| {
|
||||
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")
|
||||
therefore there exists only one instance of the Arc; QED")
|
||||
});
|
||||
|
||||
// We leave `Poisoned` as the state when returning.
|
||||
|
@ -92,7 +92,7 @@ where
|
||||
) {
|
||||
let observed = self.observed_addresses.get(&peer_id)
|
||||
.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);
|
||||
self.futures.push(future);
|
||||
}
|
||||
|
Reference in New Issue
Block a user