Skip to content

Commit

Permalink
Add comment explaining what FormattedFields is
Browse files Browse the repository at this point in the history
  • Loading branch information
davidpdrsn committed Jan 27, 2021
1 parent 894bc3f commit a0b7e85
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions tracing-subscriber/src/fmt/format/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -82,9 +82,13 @@ use fmt::{Debug, Display};
/// write!(writer, "{}", span.name())?;
///
/// let ext = span.extensions();
///
/// // `FormattedFields` is a a formatted representation of the span's
/// // fields which are stored in its extensions
/// let fields = &ext
/// .get::<FormattedFields<N>>()
/// .expect("will never be `None`");
///
/// if !fields.is_empty() {
/// write!(writer, "{{{}}}", fields)?;
/// }
Expand Down

0 comments on commit a0b7e85

Please sign in to comment.