diff --git a/opentracing-api/src/context.rs b/opentracing-api/src/context.rs index 655c142..5220a77 100644 --- a/opentracing-api/src/context.rs +++ b/opentracing-api/src/context.rs @@ -1,7 +1,7 @@ -/// SpanContext represents Span state that must propagate to +/// `SpanContext` represents Span state that must propagate to /// descendant Spans and across process boundaries. /// -/// SpanContext is logically divided into two pieces: (1) the user-level "Baggage" that +/// `SpanContext` is logically divided into two pieces: (1) the user-level "Baggage" that /// propagates across Span boundaries and (2) any Tracer-implementation-specific fields /// that are needed to identify or otherwise contextualize the associated Span instance /// (e.g., a `(trace_id, span_id, sampled)` tuple). @@ -25,9 +25,10 @@ mod tests { struct TestContext { items: HashMap, } + impl<'a> SpanContext<'a> for TestContext { type Iter = HashMapIter<'a, String, String>; - + fn baggage_items(&'a self) -> Self::Iter { self.items.iter() } @@ -37,9 +38,7 @@ mod tests { fn get_items() { let mut items = HashMap::new(); items.insert("key".into(), "value".into()); - let context = TestContext { - items: items - }; + let context = TestContext { items: items }; let items: Vec<(&String, &String)> = context.baggage_items().collect(); assert_eq!(items, [(&"key".into(), &"value".into())]) } diff --git a/opentracing-api/src/lib.rs b/opentracing-api/src/lib.rs index c49bc73..ac6ec50 100644 --- a/opentracing-api/src/lib.rs +++ b/opentracing-api/src/lib.rs @@ -5,5 +5,5 @@ mod tag; mod field; pub use context::SpanContext; -pub use tag::{Tags, ParseTagsError}; +pub use tag::{ParseTagsError, Tags}; pub use field::{Fields, ParseFieldsError}; diff --git a/opentracing-mock/src/lib.rs b/opentracing-mock/src/lib.rs index 839fa3c..f4f7659 100644 --- a/opentracing-mock/src/lib.rs +++ b/opentracing-mock/src/lib.rs @@ -1 +1 @@ -#![doc(html_root_url = "https://docs.rs/opentracing-mock/0.1.0")] \ No newline at end of file +#![doc(html_root_url = "https://docs.rs/opentracing-mock/0.1.0")] diff --git a/opentracing-noop/src/lib.rs b/opentracing-noop/src/lib.rs index 43e8dbb..d3ee850 100644 --- a/opentracing-noop/src/lib.rs +++ b/opentracing-noop/src/lib.rs @@ -1 +1 @@ -#![doc(html_root_url = "https://docs.rs/opentracing-noop/0.1.0")] \ No newline at end of file +#![doc(html_root_url = "https://docs.rs/opentracing-noop/0.1.0")]