From bd015e82dc6aec3a0392e31e46105de6ec51d41a Mon Sep 17 00:00:00 2001 From: Chris Gillespie <6572184+gillespiecd@users.noreply.github.com> Date: Mon, 28 Sep 2020 20:33:43 -0700 Subject: [PATCH] Tidy up crates in nu-protocol (#2611) * Remove unneeded crates from nu-protocol * Simplify join, use std fn --- Cargo.lock | 3 --- crates/nu-protocol/Cargo.toml | 3 --- crates/nu-protocol/src/value.rs | 11 ++++------- 3 files changed, 4 insertions(+), 13 deletions(-) diff --git a/Cargo.lock b/Cargo.lock index f666225efe..4c46b95088 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -3048,15 +3048,12 @@ dependencies = [ name = "nu-protocol" version = "0.20.0" dependencies = [ - "ansi_term 0.12.1", "bigdecimal", "byte-unit", "chrono", - "codespan-reporting", "derive-new", "getset", "indexmap", - "itertools", "log 0.4.11", "nu-errors", "nu-source", diff --git a/crates/nu-protocol/Cargo.toml b/crates/nu-protocol/Cargo.toml index 28ff20765c..4e8e36ec77 100644 --- a/crates/nu-protocol/Cargo.toml +++ b/crates/nu-protocol/Cargo.toml @@ -10,15 +10,12 @@ version = "0.20.0" doctest = false [dependencies] -ansi_term = "0.12.1" bigdecimal = {version = "0.2.0", features = ["serde"]} byte-unit = "4.0.9" chrono = {version = "0.4.15", features = ["serde"]} -codespan-reporting = "0.9.5" derive-new = "0.5.8" getset = "0.1.1" indexmap = {version = "1.6.0", features = ["serde-1"]} -itertools = "0.9.0" log = "0.4.11" nu-errors = {path = "../nu-errors", version = "0.20.0"} nu-source = {path = "../nu-source", version = "0.20.0"} diff --git a/crates/nu-protocol/src/value.rs b/crates/nu-protocol/src/value.rs index d64fb730aa..e58cdcba02 100644 --- a/crates/nu-protocol/src/value.rs +++ b/crates/nu-protocol/src/value.rs @@ -16,12 +16,11 @@ use crate::value::dict::Dictionary; use crate::value::iter::{RowValueIter, TableValueIter}; use crate::value::primitive::Primitive; use crate::value::range::{Range, RangeInclusion}; -use crate::{ColumnPath, PathMember, UnspannedPathMember}; +use crate::{ColumnPath, PathMember}; use bigdecimal::BigDecimal; use bigdecimal::FromPrimitive; use chrono::{DateTime, Utc}; use indexmap::IndexMap; -use itertools::Itertools; use nu_errors::ShellError; use nu_source::{AnchorLocation, HasSpan, Span, Spanned, Tag}; use num_bigint::BigInt; @@ -314,12 +313,10 @@ impl Value { UntaggedValue::Primitive(Primitive::Filesize(x)) => format!("{}", x), UntaggedValue::Primitive(Primitive::Path(x)) => format!("{}", x.display()), UntaggedValue::Primitive(Primitive::ColumnPath(path)) => { - let joined = path + let joined: String = path .iter() - .map(|member| match &member.unspanned { - UnspannedPathMember::String(name) => name.to_string(), - UnspannedPathMember::Int(n) => format!("{}", n), - }) + .map(|member| member.as_string()) + .collect::>() .join("."); if joined.contains(' ') {