Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

docs: fix typos in some comments #5196

Closed
wants to merge 1 commit into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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 on 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 @@ -167,7 +167,7 @@
}

impl cmp::PartialEq for PublicKey {
fn eq(&self, other: &Self) -> bool {

Check failure on line 170 in identity/src/secp256k1.rs

View workflow job for this annotation

GitHub Actions / clippy (beta)

function cannot return without recursing
self.to_bytes().eq(&other.to_bytes())
}
}
Expand Down Expand Up @@ -214,7 +214,7 @@
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 @@ -2397,7 +2397,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 @@ -2151,7 +2151,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 @@ -720,7 +720,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
Loading