From e09160e80d11e1b096a8f3c0eb3e2c42db837053 Mon Sep 17 00:00:00 2001 From: Ryan Blecher Date: Mon, 28 Oct 2019 20:22:51 -0400 Subject: [PATCH] add ability to create PathBuf from string to avoid type mismatch --- src/data/base.rs | 1 + 1 file changed, 1 insertion(+) diff --git a/src/data/base.rs b/src/data/base.rs index 2cf1f2ced..bc567f0df 100644 --- a/src/data/base.rs +++ b/src/data/base.rs @@ -817,6 +817,7 @@ impl Tagged { pub(crate) fn as_path(&self) -> Result { match self.item() { Value::Primitive(Primitive::Path(path)) => Ok(path.clone()), + Value::Primitive(Primitive::String(path_str)) => Ok(PathBuf::from(&path_str).clone()), other => Err(ShellError::type_error( "Path", other.type_name().tagged(self.tag()),