From 526d94d8622d03f97093aac0ffa1910abb53f2f5 Mon Sep 17 00:00:00 2001 From: Yehuda Katz Date: Thu, 28 Nov 2019 09:01:39 -0800 Subject: [PATCH] improve duration print original commit: ddb9d3a864b76250cd68799e244aadb050229f92 --- src/data/base/shape.rs | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/src/data/base/shape.rs b/src/data/base/shape.rs index 8a95513022..0cb086a434 100644 --- a/src/data/base/shape.rs +++ b/src/data/base/shape.rs @@ -1,12 +1,13 @@ +use crate::data::primitive::format_primitive; use crate::prelude::*; use chrono::{DateTime, Utc}; use chrono_humanize::Humanize; use derive_new::new; use indexmap::IndexMap; +use nu_errors::ShellError; use nu_protocol::{ ColumnPath, Dictionary, Evaluate, Primitive, ShellTypeName, UntaggedValue, Value, }; -use nu_errors::ShellError; use nu_source::{b, DebugDoc, PrettyDebug}; use std::collections::BTreeMap; use std::fmt::Debug; @@ -340,7 +341,7 @@ impl PrettyDebug for FormatInlineShape { }), InlineShape::Date(date) => b::primitive(date.humanize()), InlineShape::Duration(duration) => { - (b::kind("duration") + b::space() + b::primitive(duration)).group() + b::description(format_primitive(&Primitive::Duration(*duration), None)) } InlineShape::Path(path) => b::primitive(path.display()), InlineShape::Binary => b::opaque(""),