Skip to content

Commit b77c395

Browse files
committed
subscriber(docs): rename trait CollectorExt to CollectExt
The trait being augmented is the 'Collect' trait, so name the trait that extends it 'CollectExt'. This is in keeping with the extension trait naming conventions documented in Rust RFC-445, and also with the spirit of the discussion in tokio-rs/tracing PR tokio-rs#1015.
1 parent 1f3e095 commit b77c395

5 files changed

Lines changed: 13 additions & 13 deletions

File tree

examples/examples/opentelemetry-remote-context.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@ use opentelemetry::{global, Context};
33
use std::collections::HashMap;
44
use tracing::span;
55
use tracing_opentelemetry::OpenTelemetrySpanExt;
6-
use tracing_subscriber::subscribe::CollectorExt;
6+
use tracing_subscriber::subscribe::CollectExt;
77
use tracing_subscriber::Registry;
88

99
fn make_request(_cx: Context) {

tracing-opentelemetry/src/layer.rs

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -43,7 +43,7 @@ where
4343
/// # Examples
4444
///
4545
/// ```rust,no_run
46-
/// use tracing_subscriber::subscribe::CollectorExt;
46+
/// use tracing_subscriber::subscribe::CollectExt;
4747
/// use tracing_subscriber::Registry;
4848
///
4949
/// // Use the tracing subscriber `Registry`, or any other subscriber
@@ -249,7 +249,7 @@ where
249249
///
250250
/// ```no_run
251251
/// use tracing_opentelemetry::OpenTelemetryLayer;
252-
/// use tracing_subscriber::subscribe::CollectorExt;
252+
/// use tracing_subscriber::subscribe::CollectExt;
253253
/// use tracing_subscriber::Registry;
254254
///
255255
/// // Create a jaeger exporter pipeline for a `trace_demo` service.
@@ -283,7 +283,7 @@ where
283283
/// # Examples
284284
///
285285
/// ```no_run
286-
/// use tracing_subscriber::subscribe::CollectorExt;
286+
/// use tracing_subscriber::subscribe::CollectExt;
287287
/// use tracing_subscriber::Registry;
288288
///
289289
/// // Create a jaeger exporter pipeline for a `trace_demo` service.

tracing-opentelemetry/src/lib.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -53,7 +53,7 @@
5353
//! ```
5454
//! use opentelemetry::exporter::trace::stdout;
5555
//! use tracing::{error, span};
56-
//! use tracing_subscriber::subscribe::CollectorExt;
56+
//! use tracing_subscriber::subscribe::CollectExt;
5757
//! use tracing_subscriber::Registry;
5858
//!
5959
//! // Create a new OpenTelemetry pipeline

tracing-subscriber/src/prelude.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ pub use crate::field::{
88
RecordFields as __tracing_subscriber_field_RecordFields,
99
};
1010
pub use crate::subscribe::{
11-
CollectorExt as __tracing_subscriber_SubscriberExt, Subscribe as __tracing_subscriber_Layer,
11+
CollectExt as __tracing_subscriber_SubscriberExt, Subscribe as __tracing_subscriber_Layer,
1212
};
1313

1414
pub use crate::util::SubscriberInitExt as _;

tracing-subscriber/src/subscribe.rs

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -40,7 +40,7 @@ use std::{any::TypeId, marker::PhantomData};
4040
/// particular `Collect` implementation, or additional trait bounds may be
4141
/// added to constrain what types implementing `Collect` a subscriber can wrap.
4242
///
43-
/// Subscribers may be added to a `Collect` by using the [`CollectorExt::with`]
43+
/// Subscribers may be added to a `Collect` by using the [`CollectExt::with`]
4444
/// method, which is provided by `tracing-subscriber`'s [prelude]. This method
4545
/// returns a [`Layered`] struct that implements `Collect` by composing the
4646
/// subscriber with the collector.
@@ -143,8 +143,8 @@ use std::{any::TypeId, marker::PhantomData};
143143
///
144144
/// The [`Subscribe::with_collector` method][with-col] constructs the `Layered`
145145
/// type from a `Subscribe` and `Collect`, and is called by
146-
/// [`CollectorExt::with`]. In general, it is more idiomatic to use
147-
/// `CollectorExt::with`, and treat `Subscribe::with_collector` as an
146+
/// [`CollectExt::with`]. In general, it is more idiomatic to use
147+
/// `CollectExt::with`, and treat `Subscribe::with_collector` as an
148148
/// implementation detail, as `with_collector` calls must be nested, leading to
149149
/// less clear code for the reader. However, subscribers which wish to perform
150150
/// additional behavior when composed with a subscriber may provide their own
@@ -501,8 +501,8 @@ where
501501
}
502502
}
503503

504-
/// Extension trait adding a `with(Subscriber)` combinator to `Collector`s.
505-
pub trait CollectorExt: Collect + crate::sealed::Sealed {
504+
/// Extension trait adding a `with(Subscriber)` combinator to `Collect`.
505+
pub trait CollectExt: Collect + crate::sealed::Sealed {
506506
/// Wraps `self` with the provided `layer`.
507507
fn with<S>(self, subscriber: S) -> Layered<S, Self>
508508
where
@@ -921,10 +921,10 @@ where
921921
// }
922922
// }
923923

924-
// === impl CollectorExt ===
924+
// === impl CollectExt ===
925925

926926
impl<C: Collect> crate::sealed::Sealed for C {}
927-
impl<C: Collect> CollectorExt for C {}
927+
impl<C: Collect> CollectExt for C {}
928928

929929
// === impl Context ===
930930

0 commit comments

Comments
 (0)