mirror of
https://github.com/nushell/nushell.git
synced 2025-08-09 01:24:58 +02:00
Tidy up crates in nu-protocol (#2611)
* Remove unneeded crates from nu-protocol * Simplify join, use std fn
This commit is contained in:
@ -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::<Vec<String>>()
|
||||
.join(".");
|
||||
|
||||
if joined.contains(' ') {
|
||||
|
Reference in New Issue
Block a user