mirror of
https://github.com/nushell/nushell.git
synced 2025-08-09 09:15:42 +02:00
Make grouping more flexible. (#1741)
This commit is contained in:
committed by
GitHub
parent
9a94b3c656
commit
f93ff9ec33
@ -272,6 +272,13 @@ impl Value {
|
||||
}
|
||||
}
|
||||
|
||||
pub fn format(&self, fmt: &str) -> Result<String, ShellError> {
|
||||
match &self.value {
|
||||
UntaggedValue::Primitive(Primitive::Date(dt)) => Ok(dt.format(fmt).to_string()),
|
||||
_ => Err(ShellError::type_error("date", self.spanned_type_name())),
|
||||
}
|
||||
}
|
||||
|
||||
/// View into the borrowed string contents of a Value, if possible
|
||||
pub fn as_forgiving_string(&self) -> Result<&str, ShellError> {
|
||||
match &self.value {
|
||||
|
Reference in New Issue
Block a user