diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index dbdb518..cb2e264 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -87,6 +87,15 @@ jobs: command: clippy args: --all-targets --features ${{ matrix.otel_version }} --workspace -- -D warnings + typos: + name: Spell Check with Typos + runs-on: ubuntu-latest + steps: + - name: Checkout Actions Repository + uses: actions/checkout@v4 + - name: Check spelling + uses: crate-ci/typos@master + docs: name: Docs runs-on: ubuntu-latest diff --git a/README.md b/README.md index 432b152..01871df 100644 --- a/README.md +++ b/README.md @@ -15,7 +15,7 @@ implementations. This repository also contains a couple of useful concrete middl * [`reqwest-tracing`](https://crates.io/crates/reqwest-tracing): [`tracing`](https://crates.io/crates/tracing) integration, optional opentelemetry support. -Note about browser support: automated tests targetting wasm are disabled. The crate may work with +Note about browser support: automated tests targeting wasm are disabled. The crate may work with wasm but wasm support is unmaintained. PRs improving wasm are still welcome but you'd need to reintroduce the tests and get them passing before we'd merge it (see https://github.com/TrueLayer/reqwest-middleware/pull/105). diff --git a/reqwest-retry/src/middleware.rs b/reqwest-retry/src/middleware.rs index 5d1b199..4b3cf82 100644 --- a/reqwest-retry/src/middleware.rs +++ b/reqwest-retry/src/middleware.rs @@ -90,7 +90,7 @@ where next: Next<'_>, ) -> Result { // TODO: Ideally we should create a new instance of the `Extensions` map to pass - // downstream. This will guard against previous retries poluting `Extensions`. + // downstream. This will guard against previous retries polluting `Extensions`. // That is, we only return what's populated in the typemap for the last retry attempt // and copy those into the the `global` Extensions map. self.execute_with_retry(req, next, extensions).await diff --git a/reqwest-retry/src/retryable.rs b/reqwest-retry/src/retryable.rs index dfeed24..0a87dcd 100644 --- a/reqwest-retry/src/retryable.rs +++ b/reqwest-retry/src/retryable.rs @@ -4,7 +4,7 @@ use reqwest_middleware::Error; /// Classification of an error/status returned by request. #[derive(PartialEq, Eq)] pub enum Retryable { - /// The failure was due to something tha might resolve in the future. + /// The failure was due to something that might resolve in the future. Transient, /// Unresolvable error. Fatal, diff --git a/reqwest-retry/src/retryable_strategy.rs b/reqwest-retry/src/retryable_strategy.rs index dddce05..982a0bf 100644 --- a/reqwest-retry/src/retryable_strategy.rs +++ b/reqwest-retry/src/retryable_strategy.rs @@ -59,7 +59,7 @@ use reqwest_middleware::Error; /// let retry_policy = ExponentialBackoff::builder() /// .build_with_max_retries(2); /// -/// // Create the actual middleware, with the exponential backoff and custom retry stategy. +/// // Create the actual middleware, with the exponential backoff and custom retry strategy. /// let ret_s = RetryTransientMiddleware::new_with_policy_and_strategy( /// retry_policy, /// Retry201, @@ -154,7 +154,7 @@ pub fn default_on_request_failure(error: &Error) -> Option { #[cfg(not(target_arch = "wasm32"))] if let Some(hyper_error) = get_source_error_type::(&error) { // The hyper::Error(IncompleteMessage) is raised if the HTTP response is well formatted but does not contain all the bytes. - // This can happen when the server has started sending back the response but the connection is cut halfway thorugh. + // This can happen when the server has started sending back the response but the connection is cut halfway through. // We can safely retry the call, hence marking this error as [`Retryable::Transient`]. // Instead hyper::Error(Canceled) is raised when the connection is // gracefully closed on the server side. diff --git a/reqwest-retry/tests/all/retry.rs b/reqwest-retry/tests/all/retry.rs index 5a0053e..902b8a5 100644 --- a/reqwest-retry/tests/all/retry.rs +++ b/reqwest-retry/tests/all/retry.rs @@ -76,7 +76,7 @@ macro_rules! assert_retry_succeeds_inner { macro_rules! assert_retry_succeeds { ($x:tt, $status:expr) => { paste! { - assert_retry_succeeds_inner!($x, [], $status, 3, 2, RetryResponder::new(3 as u32, $x)); + assert_retry_succeeds_inner!($x, [], $status, 3, 2, RetryResponder::new(3 as u32, $x)); } }; } @@ -275,7 +275,7 @@ async fn assert_retry_on_hyper_canceled() { let mut buffer = Vec::new(); stream.read_buf(&mut buffer).await.unwrap(); if counter.fetch_add(1, Ordering::SeqCst) > 1 { - // This triggeres hyper:Error(Canceled). + // This triggers hyper:Error(Canceled). let _res = stream .into_std() .unwrap() @@ -326,7 +326,7 @@ async fn assert_retry_on_connection_reset_by_peer() { let mut buffer = Vec::new(); stream.read_buf(&mut buffer).await.unwrap(); if counter.fetch_add(1, Ordering::SeqCst) > 1 { - // This triggeres hyper:Error(Io, io::Error(ConnectionReset)). + // This triggers hyper:Error(Io, io::Error(ConnectionReset)). drop(stream); } else { let _res = stream.write("HTTP/1.1 200 OK\r\n\r\n".as_bytes()).await; diff --git a/reqwest-tracing/src/reqwest_otel_span_builder.rs b/reqwest-tracing/src/reqwest_otel_span_builder.rs index 6e7729f..f2f452d 100644 --- a/reqwest-tracing/src/reqwest_otel_span_builder.rs +++ b/reqwest-tracing/src/reqwest_otel_span_builder.rs @@ -41,7 +41,7 @@ pub const HTTP_USER_AGENT: &str = "http.user_agent"; /// /// [`TracingMiddleware`]: crate::middleware::TracingMiddleware. pub trait ReqwestOtelSpanBackend { - /// Initalized a new span before the request is executed. + /// Initialized a new span before the request is executed. fn on_request_start(req: &Request, extension: &mut Extensions) -> Span; /// Runs after the request call has executed. diff --git a/reqwest-tracing/src/reqwest_otel_span_macro.rs b/reqwest-tracing/src/reqwest_otel_span_macro.rs index 5c1237f..7e32a35 100644 --- a/reqwest-tracing/src/reqwest_otel_span_macro.rs +++ b/reqwest-tracing/src/reqwest_otel_span_macro.rs @@ -54,7 +54,7 @@ /// If nothing else is specified, the span generated by `reqwest_otel_span!` is identical to the one you'd /// get by using [`DefaultSpanBackend`]. Note that to avoid leaking sensitive information, the /// macro doesn't include `http.url`, even though it's required by opentelemetry. You can add the -/// URL attribute explicitly by usng [`SpanBackendWithUrl`] instead of `DefaultSpanBackend` or +/// URL attribute explicitly by using [`SpanBackendWithUrl`] instead of `DefaultSpanBackend` or /// adding the field on your own implementation. /// /// You can define new fields following the same syntax of [`tracing::info_span!`] for fields: