Skip to content

Commit

Permalink
Expose Writer::new as public
Browse files Browse the repository at this point in the history
Solves tokio-rs#2512

I'm writing a custom formatting layer and want to use UtcTime and format_time to format the time into a string.
  • Loading branch information
goodspark authored Mar 21, 2023
1 parent a0126b2 commit 2313da9
Showing 1 changed file with 1 addition and 5 deletions.
6 changes: 1 addition & 5 deletions tracing-subscriber/src/fmt/format/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -419,11 +419,7 @@ pub struct Format<F = Full, T = SystemTime> {
// === impl Writer ===

impl<'writer> Writer<'writer> {
// TODO(eliza): consider making this a public API?
// We may not want to do that if we choose to expose specialized
// constructors instead (e.g. `from_string` that stores whether the string
// is empty...?)
pub(crate) fn new(writer: &'writer mut impl fmt::Write) -> Self {
pub fn new(writer: &'writer mut impl fmt::Write) -> Self {
Self {
writer: writer as &mut dyn fmt::Write,
is_ansi: false,
Expand Down

0 comments on commit 2313da9

Please sign in to comment.