Skip to content

Commit

Permalink
docs: fix typos in some comments
Browse files Browse the repository at this point in the history
The same as #5196

There are some problem when merging #5196, resubmit this mr.

Pull-Request: #5255.
  • Loading branch information
cuishuang authored and guillaumemichel committed Mar 28, 2024
1 parent 0aef95c commit b8b157a
Show file tree
Hide file tree
Showing 10 changed files with 15 additions and 15 deletions.
4 changes: 2 additions & 2 deletions core/src/transport.rs
Original file line number Diff line number Diff line change
Expand Up @@ -311,7 +311,7 @@ pub enum TransportEvent<TUpgr, TErr> {

impl<TUpgr, TErr> TransportEvent<TUpgr, TErr> {
/// In case this [`TransportEvent`] is an upgrade, apply the given function
/// to the upgrade and produce another transport event based the the function's result.
/// to the upgrade and produce another transport event based the function's result.
pub fn map_upgrade<U>(self, map: impl FnOnce(TUpgr) -> U) -> TransportEvent<U, TErr> {
match self {
TransportEvent::Incoming {
Expand Down Expand Up @@ -530,7 +530,7 @@ pub enum TransportError<TErr> {
}

impl<TErr> TransportError<TErr> {
/// Applies a function to the the error in [`TransportError::Other`].
/// Applies a function to the error in [`TransportError::Other`].
pub fn map<TNewErr>(self, map: impl FnOnce(TErr) -> TNewErr) -> TransportError<TNewErr> {
match self {
TransportError::MultiaddrNotSupported(addr) => {
Expand Down
4 changes: 2 additions & 2 deletions deny.toml
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@ ignore = [
[licenses]
# The lint level for crates which do not have a detectable license
unlicensed = "deny"
# List of explictly allowed licenses
# List of explicitly allowed licenses
# See https://spdx.org/licenses/ for list of possible licenses
# [possible values: any SPDX 3.7 short identifier (+ optional exception)].
allow = [
Expand All @@ -46,7 +46,7 @@ allow = [
"MIT",
"Unlicense",
]
# List of explictly disallowed licenses
# List of explicitly disallowed licenses
# See https://spdx.org/licenses/ for list of possible licenses
# [possible values: any SPDX 3.7 short identifier (+ optional exception)].
deny = []
Expand Down
2 changes: 1 addition & 1 deletion examples/stream/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ To run the example, follow these steps:
cargo run --bin stream-example -- <address>
```

3. Both terminals should now continuosly print messages.
3. Both terminals should now continuously print messages.

## Conclusion

Expand Down
2 changes: 1 addition & 1 deletion identity/src/secp256k1.rs
Original file line number Diff line number Diff line change
Expand Up @@ -214,7 +214,7 @@ impl PublicKey {
self.0.serialize()
}

/// Decode a public key from a byte slice in the the format produced
/// Decode a public key from a byte slice in the format produced
/// by `encode`.
pub fn try_from_bytes(k: &[u8]) -> Result<PublicKey, DecodingError> {
libsecp256k1::PublicKey::parse_slice(k, Some(libsecp256k1::PublicKeyFormat::Compressed))
Expand Down
2 changes: 1 addition & 1 deletion protocols/gossipsub/src/behaviour/tests.rs
Original file line number Diff line number Diff line change
Expand Up @@ -2392,7 +2392,7 @@ fn test_dont_graft_to_negative_scored_peers() {
}

///Note that in this test also without a penalty the px would be ignored because of the
/// acceptPXThreshold, but the spec still explicitely states the rule that px from negative
/// acceptPXThreshold, but the spec still explicitly states the rule that px from negative
/// peers should get ignored, therefore we test it here.
#[test]
fn test_ignore_px_from_negative_scored_peer() {
Expand Down
8 changes: 4 additions & 4 deletions protocols/gossipsub/src/config.rs
Original file line number Diff line number Diff line change
Expand Up @@ -262,9 +262,9 @@ impl Config {
self.unsubscribe_backoff
}

/// Number of heartbeat slots considered as slack for backoffs. This gurantees that we wait
/// Number of heartbeat slots considered as slack for backoffs. This guarantees that we wait
/// at least backoff_slack heartbeats after a backoff is over before we try to graft. This
/// solves problems occuring through high latencies. In particular if
/// solves problems occurring through high latencies. In particular if
/// `backoff_slack * heartbeat_interval` is longer than any latencies between processing
/// prunes on our side and processing prunes on the receiving side this guarantees that we
/// get not punished for too early grafting. The default is 1.
Expand Down Expand Up @@ -660,9 +660,9 @@ impl ConfigBuilder {
self
}

/// Number of heartbeat slots considered as slack for backoffs. This gurantees that we wait
/// Number of heartbeat slots considered as slack for backoffs. This guarantees that we wait
/// at least backoff_slack heartbeats after a backoff is over before we try to graft. This
/// solves problems occuring through high latencies. In particular if
/// solves problems occurring through high latencies. In particular if
/// `backoff_slack * heartbeat_interval` is longer than any latencies between processing
/// prunes on our side and processing prunes on the receiving side this guarantees that we
/// get not punished for too early grafting. The default is 1.
Expand Down
2 changes: 1 addition & 1 deletion protocols/kad/src/behaviour.rs
Original file line number Diff line number Diff line change
Expand Up @@ -2203,7 +2203,7 @@ where
Some(peer) => peer,
};

// We should order addresses from decreasing likelyhood of connectivity, so start with
// We should order addresses from decreasing likelihood of connectivity, so start with
// the addresses of that peer in the k-buckets.
let key = kbucket::Key::from(peer_id);
let mut peer_addrs =
Expand Down
2 changes: 1 addition & 1 deletion protocols/kad/src/kbucket.rs
Original file line number Diff line number Diff line change
Expand Up @@ -344,7 +344,7 @@ enum ClosestBucketsIterState {
/// The starting state of the iterator yields the first bucket index and
/// then transitions to `ZoomIn`.
Start(BucketIndex),
/// The iterator "zooms in" to to yield the next bucket cotaining nodes that
/// The iterator "zooms in" to yield the next bucket cotaining nodes that
/// are incrementally closer to the local node but further from the `target`.
/// These buckets are identified by a `1` in the corresponding bit position
/// of the distance bit string. When bucket `0` is reached, the iterator
Expand Down
2 changes: 1 addition & 1 deletion swarm/src/connection.rs
Original file line number Diff line number Diff line change
Expand Up @@ -717,7 +717,7 @@ impl<UserData, Upgrade> Future for SubstreamRequested<UserData, Upgrade> {

/// The options for a planned connection & handler shutdown.
///
/// A shutdown is planned anew based on the the return value of
/// A shutdown is planned anew based on the return value of
/// [`ConnectionHandler::connection_keep_alive`] of the underlying handler
/// after every invocation of [`ConnectionHandler::poll`].
///
Expand Down
2 changes: 1 addition & 1 deletion transports/websocket/src/framed.rs
Original file line number Diff line number Diff line change
Expand Up @@ -521,7 +521,7 @@ fn parse_ws_dial_addr<T>(addr: Multiaddr) -> Result<WsAddress, Error<T>> {
};

// The original address, stripped of the `/ws` and `/wss` protocols,
// makes up the the address for the inner TCP-based transport.
// makes up the address for the inner TCP-based transport.
let tcp_addr = match p2p {
Some(p) => protocols.with(p),
None => protocols,
Expand Down

0 comments on commit b8b157a

Please sign in to comment.