From 7c18832247e853800e90834ecb04bcc3ee6ec4d1 Mon Sep 17 00:00:00 2001 From: Eliza Weisman Date: Wed, 18 Dec 2019 16:35:00 -0800 Subject: [PATCH] fmt: add public constructor to `FormattedFields` Signed-off-by: Eliza Weisman --- tracing-subscriber/src/fmt/fmt_layer.rs | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/tracing-subscriber/src/fmt/fmt_layer.rs b/tracing-subscriber/src/fmt/fmt_layer.rs index 1851498b8b..8d85cf3fff 100644 --- a/tracing-subscriber/src/fmt/fmt_layer.rs +++ b/tracing-subscriber/src/fmt/fmt_layer.rs @@ -294,6 +294,16 @@ pub struct FormattedFields { pub fields: String, } +impl FormattedFields { + /// Returns a new `FormattedFields`. + pub fn new(fields: String) -> Self { + Self { + fields, + _format_event: PhantomData, + } + } +} + impl fmt::Debug for FormattedFields { fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result { f.debug_struct("FormattedFields")