From 3c9c68ec8993d6c7fcae1d364a1d588560065e7c Mon Sep 17 00:00:00 2001 From: John Vandenberg Date: Mon, 15 Jan 2024 14:01:34 +0800 Subject: [PATCH] chore: Fix spelling --- examples/examples/fmt/yak_shave.rs | 2 +- tracing-core/src/metadata.rs | 2 +- tracing-error/CHANGELOG.md | 2 +- tracing-error/src/error.rs | 2 +- tracing-mock/src/subscriber.rs | 2 +- tracing-subscriber/CHANGELOG.md | 12 ++++++------ tracing-subscriber/src/filter/env/mod.rs | 2 +- tracing-subscriber/src/filter/filter_fn.rs | 2 +- tracing-subscriber/src/filter/mod.rs | 2 +- .../src/filter/subscriber_filters/mod.rs | 2 +- tracing-subscriber/src/fmt/format/mod.rs | 2 +- tracing-subscriber/src/fmt/time/datetime.rs | 2 +- tracing-subscriber/src/subscribe/mod.rs | 10 +++++----- tracing/CHANGELOG.md | 2 +- tracing/README.md | 4 ++-- tracing/src/lib.rs | 2 +- tracing/src/macros.rs | 2 +- tracing/tests/enabled.rs | 2 +- 18 files changed, 28 insertions(+), 28 deletions(-) diff --git a/examples/examples/fmt/yak_shave.rs b/examples/examples/fmt/yak_shave.rs index 6e60a9fd8b..6639f8ddd4 100644 --- a/examples/examples/fmt/yak_shave.rs +++ b/examples/examples/fmt/yak_shave.rs @@ -5,7 +5,7 @@ use tracing::{debug, error, info, span, trace, warn, Level}; // the `#[tracing::instrument]` attribute creates and enters a span // every time the instrumented function is called. The span is named after -// the function or method. Paramaters passed to the function are recorded as fields. +// the function or method. Parameters passed to the function are recorded as fields. #[tracing::instrument] pub fn shave(yak: usize) -> Result<(), Box> { // this creates an event at the TRACE log level with two fields: diff --git a/tracing-core/src/metadata.rs b/tracing-core/src/metadata.rs index 76d84e6d1e..3e8cb9761a 100644 --- a/tracing-core/src/metadata.rs +++ b/tracing-core/src/metadata.rs @@ -378,7 +378,7 @@ impl Kind { pub const SPAN: Kind = Kind(Self::SPAN_BIT); /// `enabled!` callsite. [`Collect`][`crate::collect::Collect`]s can assume - /// this `Kind` means they will never recieve a + /// this `Kind` means they will never receive a /// full event with this [`Metadata`]. pub const HINT: Kind = Kind(Self::HINT_BIT); diff --git a/tracing-error/CHANGELOG.md b/tracing-error/CHANGELOG.md index a1b780aa2f..54aa87e8c3 100644 --- a/tracing-error/CHANGELOG.md +++ b/tracing-error/CHANGELOG.md @@ -5,7 +5,7 @@ - **TracedError**: `TracedError`, an error type wrapper that annotates an error with the current span. - **SpanTrace**:`SpanTrace::status` method and `SpanTraceStatus` type for - determing whether a `SpanTrace` was successfully captured (#614) + determining whether a `SpanTrace` was successfully captured (#614) ### Changed diff --git a/tracing-error/src/error.rs b/tracing-error/src/error.rs index 51bd599ee1..cdc2864cf3 100644 --- a/tracing-error/src/error.rs +++ b/tracing-error/src/error.rs @@ -74,7 +74,7 @@ where // erased `ErrorImpl` back to its original type, which is needed in order to forward our // error/display/debug impls to the internal error type from the type erased error type. // - // The repr(C) is necessary to ensure that the struct is layed out in the order we + // The repr(C) is necessary to ensure that the struct is laid out in the order we // specified it, so that we can safely access the vtable and spantrace fields through a type // erased pointer to the original object. let vtable = &ErrorVTable { diff --git a/tracing-mock/src/subscriber.rs b/tracing-mock/src/subscriber.rs index 6a8c536d55..f9560065ff 100644 --- a/tracing-mock/src/subscriber.rs +++ b/tracing-mock/src/subscriber.rs @@ -1,5 +1,5 @@ //! An implementation of the [`Subscribe`] trait which validates that -//! the `tracing` data it recieves matches the expected output for a test. +//! the `tracing` data it receives matches the expected output for a test. //! //! //! The [`MockSubscriber`] is the central component in these tools. The diff --git a/tracing-subscriber/CHANGELOG.md b/tracing-subscriber/CHANGELOG.md index 132260184d..e362d87b75 100644 --- a/tracing-subscriber/CHANGELOG.md +++ b/tracing-subscriber/CHANGELOG.md @@ -57,7 +57,7 @@ Thanks to @bdonlan and @jeromegn for contributing to this release! ### Changed - **filter**: `LevelFilter` is now a re-export of the - `tracing_core::LevelFilter` type, it can now be used interchangably with the + `tracing_core::LevelFilter` type, it can now be used interchangeably with the versions in `tracing` and `tracing-core` (#853) - **filter**: Significant performance improvements when comparing `LevelFilter`s and `Level`s (#853) @@ -260,7 +260,7 @@ tuning in this release! - **fmt**: Fixed empty `{}` printed after spans with no fields (f079f2d) - **fmt**: Fixed inconsistent formatting when ANSI colors are disabled (506a482) -- **fmt**: Fixed mis-aligned levels when ANSI colors are disabled (eba1adb) +- **fmt**: Fixed misaligned levels when ANSI colors are disabled (eba1adb) - Fixed warnings on nightly Rust compilers (#558) # 0.2.0-alpha.5 (January 31, 2020) @@ -347,9 +347,9 @@ tuning in this release! changes in subsequent alpha. (#420, #425) - **BREAKING**: Removed `Filter`. Use `EnvFilter` instead (#434) -### Contributers +### Contributors -Thanks to all the contributers to this release! +Thanks to all the contributors to this release! - @pimeys for #377 and #415 @@ -375,9 +375,9 @@ Thanks to all the contributers to this release! order to initialize the global logger. Only `tracing-log` needs to be specified now (#400). -### Contributers +### Contributors -Thanks to all the contributers to this release! +Thanks to all the contributors to this release! - @emschwartz for #385, #387, #400 and #401 - @bIgBV for #388 diff --git a/tracing-subscriber/src/filter/env/mod.rs b/tracing-subscriber/src/filter/env/mod.rs index 93f44640d0..4819e7936b 100644 --- a/tracing-subscriber/src/filter/env/mod.rs +++ b/tracing-subscriber/src/filter/env/mod.rs @@ -476,7 +476,7 @@ impl EnvFilter { let level = metadata.level(); // is it possible for a dynamic filter directive to enable this event? - // if not, we can avoid the thread loca'l access + iterating over the + // if not, we can avoid the thread local access + iterating over the // spans in the current scope. if self.has_dynamics && self.dynamics.max_level >= *level { if metadata.is_span() { diff --git a/tracing-subscriber/src/filter/filter_fn.rs b/tracing-subscriber/src/filter/filter_fn.rs index eda7cef47c..b426208b25 100644 --- a/tracing-subscriber/src/filter/filter_fn.rs +++ b/tracing-subscriber/src/filter/filter_fn.rs @@ -295,7 +295,7 @@ where metadata: &'static Metadata<'static>, ) -> Interest { // Because `self.enabled` takes a `Metadata` only (and no `Context` - // parameter), we can reasonably assume its results are cachable, and + // parameter), we can reasonably assume its results are cacheable, and // just return `Interest::always`/`Interest::never`. if (self.enabled)(metadata) { debug_assert!( diff --git a/tracing-subscriber/src/filter/mod.rs b/tracing-subscriber/src/filter/mod.rs index b50e5b2628..bb0b5af5f1 100644 --- a/tracing-subscriber/src/filter/mod.rs +++ b/tracing-subscriber/src/filter/mod.rs @@ -42,7 +42,7 @@ feature! { pub use self::directive::ParseError; } -/// Stub implementations of the per-subscriber-fitler detection functions for +/// Stub implementations of the per-subscriber-filter detection functions for /// when the `registry` feature is disabled. #[cfg(not(all(feature = "registry", feature = "std")))] mod has_psf_stubs { diff --git a/tracing-subscriber/src/filter/subscriber_filters/mod.rs b/tracing-subscriber/src/filter/subscriber_filters/mod.rs index d519aa4d7c..7d98ee9d08 100644 --- a/tracing-subscriber/src/filter/subscriber_filters/mod.rs +++ b/tracing-subscriber/src/filter/subscriber_filters/mod.rs @@ -717,7 +717,7 @@ where // // it would be cool if there was some wild rust reflection way of checking // if a trait impl has the default impl of a trait method or not, but that's - // almsot certainly impossible...right? + // almost certainly impossible...right? fn register_callsite(&self, metadata: &'static Metadata<'static>) -> Interest { let interest = self.filter.callsite_enabled(metadata); diff --git a/tracing-subscriber/src/fmt/format/mod.rs b/tracing-subscriber/src/fmt/format/mod.rs index d4c619b3fb..e19d689486 100644 --- a/tracing-subscriber/src/fmt/format/mod.rs +++ b/tracing-subscriber/src/fmt/format/mod.rs @@ -1748,7 +1748,7 @@ pub(super) mod test { "^fake time tracing_subscriber::fmt::format::test: {}:[0-9]+: hello\n$", current_path() // if we're on Windows, the path might contain backslashes, which - // have to be escpaed before compiling the regex. + // have to be escaped before compiling the regex. .replace('\\', "\\\\") )) .unwrap(); diff --git a/tracing-subscriber/src/fmt/time/datetime.rs b/tracing-subscriber/src/fmt/time/datetime.rs index 5313316870..a39d2ef19c 100644 --- a/tracing-subscriber/src/fmt/time/datetime.rs +++ b/tracing-subscriber/src/fmt/time/datetime.rs @@ -387,7 +387,7 @@ mod tests { case("1901-12-13T20:45:52.000000Z", i32::MIN as i64, 0); case("1901-12-13T20:45:51.000000Z", i32::MIN as i64 - 1, 0); - // Skipping these tests on windows as std::time::SysteTime range is low + // Skipping these tests on windows as std::time::SystemTime range is low // on Windows compared with that of Unix which can cause the following // high date value tests to panic #[cfg(not(target_os = "windows"))] diff --git a/tracing-subscriber/src/subscribe/mod.rs b/tracing-subscriber/src/subscribe/mod.rs index 61a2e4b080..7d6c9d8d7f 100644 --- a/tracing-subscriber/src/subscribe/mod.rs +++ b/tracing-subscriber/src/subscribe/mod.rs @@ -430,7 +430,7 @@ //! callsite). See [`Collect::register_callsite`] and //! [`tracing_core::callsite`] for a summary of how this behaves. //! - [`enabled`], once per emitted event (roughly: once per time that `event!` -//! or `span!` is *executed*), and only if `register_callsite` regesters an +//! or `span!` is *executed*), and only if `register_callsite` registers an //! [`Interest::sometimes`]. This is the main customization point to globally //! filter events based on their [`Metadata`]. If an event can be disabled //! based only on [`Metadata`], it should be, as this allows the construction @@ -768,7 +768,7 @@ where /// [`Collect`] has been set as the default, both the subscriber and /// [`Collect`] are passed to this method _mutably_. This gives the /// subscribe the opportunity to set any of its own fields with values - /// recieved by method calls on the [`Collect`]. + /// received by method calls on the [`Collect`]. /// /// For example, [`Filtered`] subscribers implement `on_subscribe` to call the /// [`Collect`]'s [`register_filter`] method, and store the returned @@ -900,7 +900,7 @@ where /// /// **Note**: This method determines whether an event is globally enabled, /// *not* whether the individual subscriber will be notified about the - /// event. This is intended to be used by subscibers that implement + /// event. This is intended to be used by subscribers that implement /// filtering for the entire stack. Subscribers which do not wish to be /// notified about certain events but do not wish to globally disable them /// should ignore those events in their [on_event][Self::on_event]. @@ -1287,7 +1287,7 @@ pub trait Filter { ///
     /// Note: If a Filter will perform
     /// dynamic filtering that depends on the current context in which
-    /// a span or event was observered (e.g. only enabling an event when it
+    /// a span or event was observed (e.g. only enabling an event when it
     /// occurs within a particular span), it must return
     /// Interest::sometimes() from this method. If it returns
     /// Interest::always() or Interest::never(), the
@@ -1306,7 +1306,7 @@ pub trait Filter {
     /// other hand, when a `Filter` returns [`Interest::always()`][always] or
     /// [`Interest::never()`][never] for a callsite, _other_ [`Subscribe`]s may have
     /// differing interests in that callsite. If this is the case, the callsite
-    /// will recieve [`Interest::sometimes()`][sometimes], and the [`enabled`]
+    /// will receive [`Interest::sometimes()`][sometimes], and the [`enabled`]
     /// method will still be called for that callsite when it records a span or
     /// event.
     ///
diff --git a/tracing/CHANGELOG.md b/tracing/CHANGELOG.md
index 0a6c648e5c..b0af15f7b7 100644
--- a/tracing/CHANGELOG.md
+++ b/tracing/CHANGELOG.md
@@ -78,7 +78,7 @@ this release!
   filtering, improving performance when a span or event is disabled by a
   `static_max_level_XXX` feature flag (#868) 
 - `LevelFilter` is now a re-export of the `tracing_core::LevelFilter` type, it
-  can now be used interchangably with the versions in `tracing-core` and
+  can now be used interchangeably with the versions in `tracing-core` and
   `tracing-subscriber` (#853)
 - Significant performance improvements when comparing `LevelFilter`s and
   `Level`s (#853)
diff --git a/tracing/README.md b/tracing/README.md
index f5852b818d..73f5e75f08 100644
--- a/tracing/README.md
+++ b/tracing/README.md
@@ -145,7 +145,7 @@ use tracing::{debug, error, info, span, warn, Level};
 
 // the `#[tracing::instrument]` attribute creates and enters a span
 // every time the instrumented function is called. The span is named after
-// the function or method. Paramaters passed to the function are recorded as fields.
+// the function or method. Parameters passed to the function are recorded as fields.
 #[tracing::instrument]
 pub fn shave(yak: usize) -> Result<(), Box> {
     // this creates an event at the DEBUG level with two fields:
@@ -186,7 +186,7 @@ pub fn shave_all(yaks: usize) -> usize {
 
         if let Err(ref error) = res {
             // Like spans, events can also use the field initialization shorthand.
-            // In this instance, `yak` is the field being initalized.
+            // In this instance, `yak` is the field being initialized.
             error!(yak, error = error.as_ref(), "failed to shave yak!");
         } else {
             yaks_shaved += 1;
diff --git a/tracing/src/lib.rs b/tracing/src/lib.rs
index 1467c907f2..de08ec408f 100644
--- a/tracing/src/lib.rs
+++ b/tracing/src/lib.rs
@@ -173,7 +173,7 @@
 //! For functions which don't have built-in tracing support and can't have
 //! the `#[instrument]` attribute applied (such as from an external crate),
 //! the [`Span` struct][`Span`] has a [`in_scope()` method][`in_scope`]
-//! which can be used to easily wrap synchonous code in a span.
+//! which can be used to easily wrap synchronous code in a span.
 //!
 //! For example:
 //! ```rust
diff --git a/tracing/src/macros.rs b/tracing/src/macros.rs
index 3756186ff7..75ead0bcb7 100644
--- a/tracing/src/macros.rs
+++ b/tracing/src/macros.rs
@@ -3044,7 +3044,7 @@ macro_rules! fieldset {
         $crate::fieldset!(@ { $($out),*, $k } $($rest)*)
     };
 
-    // Remainder is unparseable, but exists --- must be format args!
+    // Remainder is unparsable, but exists --- must be format args!
     (@ { $(,)* $($out:expr),* } $($rest:tt)+) => {
         $crate::fieldset!(@ { "message", $($out),*, })
     };
diff --git a/tracing/tests/enabled.rs b/tracing/tests/enabled.rs
index 9c82309056..860d55639f 100644
--- a/tracing/tests/enabled.rs
+++ b/tracing/tests/enabled.rs
@@ -46,7 +46,7 @@ fn span_and_event() {
 
     let _guard = tracing::collect::set_default(collector);
 
-    // Ensure that the `_event` and `_span` alternatives work corretly
+    // Ensure that the `_event` and `_span` alternatives work correctly
     assert!(!tracing::event_enabled!(Level::TRACE));
     assert!(tracing::event_enabled!(Level::DEBUG));
     assert!(tracing::span_enabled!(Level::TRACE));