Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
## Motivation <!-- Explain the context and why you're making that change. What is the problem you're trying to solve? If a new feature is being added, describe the intended use case that feature fulfills. --> The following code compiles failed: ```rust use tracing; fn main() { let span = tracing::info_span!("my_span").entered(); tracing::info!(parent: &span, "test span"); } ``` ```log Compiling playground v0.0.1 (/playground) error[E0277]: the trait bound `Option<Id>: From<&EnteredSpan>` is not satisfied --> src/main.rs:6:5 | 6 | tracing::info!(parent: &span, "test span"); | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ the trait `From<&EnteredSpan>` is not implemented for `Option<Id>` ``` ## Solution - `impl<'a> From<&'a EnteredSpan> for Option<&'a Id>`. - `impl<'a> From<&'a EnteredSpan> for Option<Id>` - Add `id()` method into `EnteredSpan`. Co-authored-by: Eliza Weisman <eliza@buoyant.io>
- Loading branch information