From 11ef00749140dcd7304b4195309c6dc555e8cc72 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Andr=C3=A9s=20N=2E=20Robalino?= Date: Tue, 10 Sep 2019 05:28:15 -0500 Subject: [PATCH] Paths can be displayed as strings. --- src/commands/config.rs | 2 +- src/data/base.rs | 1 + 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/src/commands/config.rs b/src/commands/config.rs index c60ea2f2d5..78f1ad399c 100644 --- a/src/commands/config.rs +++ b/src/commands/config.rs @@ -127,7 +127,7 @@ pub fn config( let path = config::default_path_for(&configuration)?; return Ok(stream![Tagged::from_simple_spanned_item( - Value::string(path.to_string_lossy()), + Value::Primitive(Primitive::Path(path)), span )] .from_input_stream()); diff --git a/src/data/base.rs b/src/data/base.rs index b48d692123..02ce4982b1 100644 --- a/src/data/base.rs +++ b/src/data/base.rs @@ -558,6 +558,7 @@ impl Value { Value::Primitive(Primitive::Decimal(x)) => Ok(format!("{}", x)), Value::Primitive(Primitive::Int(x)) => Ok(format!("{}", x)), Value::Primitive(Primitive::Bytes(x)) => Ok(format!("{}", x)), + Value::Primitive(Primitive::Path(x)) => Ok(format!("{}", x.display())), // TODO: this should definitely be more general with better errors other => Err(ShellError::string(format!( "Expected string, got {:?}",