use nu_protocol::{FromValue, ShellError, Value}; pub fn extract_strings(value: Value) -> Result, ShellError> { match ( ::from_value(&value), as FromValue>::from_value(&value), ) { (Ok(col), Err(_)) => Ok(vec![col]), (Err(_), Ok(cols)) => Ok(cols), _ => Err(ShellError::IncompatibleParametersSingle( "Expected a string or list of strings".into(), value.span()?, )), } }