mirror of
https://github.com/pezkuwichain/pezkuwi-subxt.git
synced 2026-07-18 11:45:42 +00:00
Major bump of tracing-subscriber version (#3891)
I don't think there are any more releases to the 0.2.x versions, so best we're on the 0.3.x release. No change on the benchmarks, fast local time is still just as fast as before: new version bench: ``` fast_local_time time: [30.551 ns 30.595 ns 30.668 ns] ``` old version bench: ``` fast_local_time time: [30.598 ns 30.646 ns 30.723 ns] ``` --------- Co-authored-by: Bastian Köcher <git@kchr.de>
This commit is contained in:
@@ -18,7 +18,7 @@
|
||||
|
||||
use chrono::{Datelike, Timelike};
|
||||
use std::{cell::RefCell, fmt::Write, time::SystemTime};
|
||||
use tracing_subscriber::fmt::time::FormatTime;
|
||||
use tracing_subscriber::fmt::{format, time::FormatTime};
|
||||
|
||||
/// A structure which, when `Display`d, will print out the current local time.
|
||||
#[derive(Debug, Clone, Copy, Eq, PartialEq, Default)]
|
||||
@@ -76,7 +76,7 @@ thread_local! {
|
||||
}
|
||||
|
||||
impl FormatTime for FastLocalTime {
|
||||
fn format_time(&self, w: &mut dyn Write) -> std::fmt::Result {
|
||||
fn format_time(&self, w: &mut format::Writer<'_>) -> std::fmt::Result {
|
||||
const TIMESTAMP_PARTIAL_LENGTH: usize = "0000-00-00 00:00:00".len();
|
||||
|
||||
let elapsed = SystemTime::now()
|
||||
@@ -128,8 +128,8 @@ impl FormatTime for FastLocalTime {
|
||||
}
|
||||
|
||||
impl std::fmt::Display for FastLocalTime {
|
||||
fn fmt(&self, w: &mut std::fmt::Formatter) -> std::fmt::Result {
|
||||
self.format_time(w)
|
||||
fn fmt(&self, mut w: &mut std::fmt::Formatter) -> std::fmt::Result {
|
||||
self.format_time(&mut format::Writer::new(&mut w))
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user