diff options
Diffstat (limited to 'crates/printer/src/util.rs')
-rw-r--r-- | crates/printer/src/util.rs | 12 |
1 files changed, 6 insertions, 6 deletions
diff --git a/crates/printer/src/util.rs b/crates/printer/src/util.rs index db19504c..04f9e129 100644 --- a/crates/printer/src/util.rs +++ b/crates/printer/src/util.rs @@ -8,9 +8,6 @@ use { }, }; -#[cfg(feature = "serde")] -use serde::{Serialize, Serializer}; - use crate::{hyperlink::HyperlinkPath, MAX_LOOK_AHEAD}; /// A type for handling replacements while amortizing allocation. @@ -385,11 +382,14 @@ impl NiceDuration { } #[cfg(feature = "serde")] -impl Serialize for NiceDuration { - fn serialize<S: Serializer>(&self, ser: S) -> Result<S::Ok, S::Error> { +impl serde::Serialize for NiceDuration { + fn serialize<S: serde::Serializer>( + &self, + ser: S, + ) -> Result<S::Ok, S::Error> { use serde::ser::SerializeStruct; - let mut state = ser.serialize_struct("Duration", 2)?; + let mut state = ser.serialize_struct("Duration", 3)?; state.serialize_field("secs", &self.0.as_secs())?; state.serialize_field("nanos", &self.0.subsec_nanos())?; state.serialize_field("human", &format!("{}", self))?; |