Skip to content

Commit 74e925d

Browse files
tobzstriezel
andauthored
chore: fix spelling errors (#775)
Co-authored-by: Dirk Stolle <striezel-dev@web.de>
1 parent 89ac74f commit 74e925d

6 files changed

Lines changed: 12 additions & 12 deletions

File tree

guides/building-a-middleware-from-scratch.md

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -390,7 +390,7 @@ means we can combine multiple errors type into one. That has the following
390390
advantages:
391391

392392
1. Our error handling is less fragile since changing the order middleware are
393-
applied in wont change the final error type.
393+
applied in won't change the final error type.
394394
2. The error type now has a constant size regardless how many middleware we've
395395
applied.
396396
3. Extracting the error no longer requires a big `match` but can instead be done
@@ -412,7 +412,7 @@ For our `Timeout` middleware that means we need to create a struct that
412412
implements `std::error::Error` such that we can convert it into a `Box<dyn
413413
std::error::Error + Send + Sync>`. We also have to require that the inner
414414
service's error type implements `Into<Box<dyn std::error::Error + Send +
415-
Sync>>`. Luckily most errors automatically satisfies that so it wont require
415+
Sync>>`. Luckily most errors automatically satisfies that so it won't require
416416
users to write any additional code. We're using `Into` for the trait bound
417417
rather than `From` as recommend by the [standard
418418
library](https://doc.rust-lang.org/stable/std/convert/trait.From.html).
@@ -521,7 +521,7 @@ where
521521

522522
## Conclusion
523523

524-
Thats it! We've now successfully implemented the `Timeout` middleware as it
524+
That's it! We've now successfully implemented the `Timeout` middleware as it
525525
exists in Tower today.
526526

527527
Our final implementation is:

tower/src/balance/p2c/mod.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@
2323
//! Since the load balancer needs to perform _random_ choices, the constructors in this module
2424
//! usually come in two forms: one that uses randomness provided by the operating system, and one
2525
//! that lets you specify the random seed to use. Usually the former is what you'll want, though
26-
//! the latter may come in handy for reproducability or to reduce reliance on the operating system.
26+
//! the latter may come in handy for reproducibility or to reduce reliance on the operating system.
2727
//!
2828
//! [Power of Two Random Choices]: http://www.eecs.harvard.edu/~michaelm/postscripts/handbook2001.pdf
2929
//! [finagle]: https://twitter.github.io/finagle/guide/Clients.html#power-of-two-choices-p2c-least-loaded

tower/src/ready_cache/cache.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,7 @@ use tracing::{debug, trace};
3131
/// in the ready set. The `ReadyCache::check_*` functions can be used to ensure
3232
/// that a service is ready before dispatching a request.
3333
///
34-
/// The ready set can hold services for an abitrarily long time. During this
34+
/// The ready set can hold services for an arbitrarily long time. During this
3535
/// time, the runtime may process events that invalidate that ready state (for
3636
/// instance, if a keepalive detects a lost connection). In such cases, callers
3737
/// should use [`ReadyCache::check_ready`] (or [`ReadyCache::check_ready_index`])

tower/src/steer/mod.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -91,7 +91,7 @@ where
9191
///
9292
/// An example use case is a sharded service.
9393
/// It accepts new requests, then:
94-
/// 1. Determines, via the provided [`Picker`], which [`Service`] the request coresponds to.
94+
/// 1. Determines, via the provided [`Picker`], which [`Service`] the request corresponds to.
9595
/// 2. Waits (in [`Service::poll_ready`]) for *all* services to be ready.
9696
/// 3. Calls the correct [`Service`] with the request, and returns a future corresponding to the
9797
/// call.

tower/src/util/call_all/ordered.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -63,7 +63,7 @@ pin_project! {
6363
/// reqs.unbounded_send("three").unwrap();
6464
/// drop(reqs);
6565
///
66-
/// // We then loop over the response Strem that we get back from call_all.
66+
/// // We then loop over the response `Stream` that we get back from call_all.
6767
/// let mut i = 0usize;
6868
/// while let Some(rsp) = rsps.next().await {
6969
/// // Each response is a Result (we could also have used TryStream::try_next)

tower/src/util/rng.rs

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -27,11 +27,11 @@ pub trait Rng {
2727
// Borrowed from:
2828
// https://github.com/rust-random/rand/blob/master/src/distributions/float.rs#L106
2929
let float_size = std::mem::size_of::<f64>() as u32 * 8;
30-
let precison = 52 + 1;
31-
let scale = 1.0 / ((1u64 << precison) as f64);
30+
let precision = 52 + 1;
31+
let scale = 1.0 / ((1u64 << precision) as f64);
3232

3333
let value = self.next_u64();
34-
let value = value >> (float_size - precison);
34+
let value = value >> (float_size - precision);
3535

3636
scale * value as f64
3737
}
@@ -111,8 +111,8 @@ where
111111

112112
/// A sampler modified from the Rand implementation for use internally for the balance middleware.
113113
///
114-
/// It's an implementation of Floyd's combination algorithm. with amount fixed at 2. This uses no allocated
115-
/// memory and finishes in constant time (only 2 random calls)
114+
/// It's an implementation of Floyd's combination algorithm with amount fixed at 2. This uses no allocated
115+
/// memory and finishes in constant time (only 2 random calls).
116116
///
117117
/// ref: This was borrowed and modified from the following Rand implementation
118118
/// https://github.com/rust-random/rand/blob/b73640705d6714509f8ceccc49e8df996fa19f51/src/seq/index.rs#L375-L411

0 commit comments

Comments
 (0)