From c18f0dcc849f43d72f2ceb1ce1bba458790b12e3 Mon Sep 17 00:00:00 2001 From: JT Date: Tue, 26 Oct 2021 11:24:10 +1300 Subject: [PATCH] range display touchup --- crates/nu-protocol/src/value/mod.rs | 26 ++++++-------------------- 1 file changed, 6 insertions(+), 20 deletions(-) diff --git a/crates/nu-protocol/src/value/mod.rs b/crates/nu-protocol/src/value/mod.rs index 3cd0b0a480..b8b2c3041a 100644 --- a/crates/nu-protocol/src/value/mod.rs +++ b/crates/nu-protocol/src/value/mod.rs @@ -167,17 +167,9 @@ impl Value { Value::Filesize { val, .. } => format_filesize(val), Value::Duration { val, .. } => format_duration(val), Value::Date { val, .. } => HumanTime::from(val).to_string(), - Value::Range { val, .. } => match val.into_range_iter() { - Ok(iter) => { - format!( - "range: [{}]", - iter.map(|x| x.into_string()) - .collect::>() - .join(", ") - ) - } - Err(error) => format!("{:?}", error), - }, + Value::Range { val, .. } => { + format!("{}..{}", val.from.into_string(), val.to.into_string()) + } Value::String { val, .. } => val, Value::List { vals: val, .. } => format!( "[{}]", @@ -210,15 +202,9 @@ impl Value { Value::Filesize { val, .. } => format!("{} bytes", val), Value::Duration { val, .. } => format!("{} ns", val), Value::Date { val, .. } => format!("{:?}", val), - Value::Range { val, .. } => match val.into_range_iter() { - Ok(iter) => iter - .map(|x| x.into_string()) - .collect::>() - .join(", "), - Err(error) => { - format!("{:?}", error) - } - }, + Value::Range { val, .. } => { + format!("{}..{}", val.from.into_string(), val.to.into_string()) + } Value::String { val, .. } => val, Value::List { vals: val, .. } => val .into_iter()