Skip to content

Commit

Permalink
fmt: add public constructor to FormattedFields (#478)
Browse files Browse the repository at this point in the history
Signed-off-by: Eliza Weisman <eliza@buoyant.io>
  • Loading branch information
hawkw authored Dec 19, 2019
1 parent a194830 commit 65547d8
Showing 1 changed file with 10 additions and 0 deletions.
10 changes: 10 additions & 0 deletions tracing-subscriber/src/fmt/fmt_layer.rs
Original file line number Diff line number Diff line change
Expand Up @@ -294,6 +294,16 @@ pub struct FormattedFields<E> {
pub fields: String,
}

impl<E> FormattedFields<E> {
/// Returns a new `FormattedFields`.
pub fn new(fields: String) -> Self {
Self {
fields,
_format_event: PhantomData,
}
}
}

impl<E> fmt::Debug for FormattedFields<E> {
fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result {
f.debug_struct("FormattedFields")
Expand Down

0 comments on commit 65547d8

Please sign in to comment.