nu-explore/ Fix recursive table issue; (#9321)

close #9318

Signed-off-by: Maxim Zhiburt <zhiburt@gmail.com>
This commit is contained in:
Maxim Zhiburt 2023-05-30 17:59:56 +03:00 committed by GitHub
parent b67b6f7fc5
commit 5f8d8b4a4b
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -184,7 +184,7 @@ fn record_lookup_value(item: &Value, header: &str) -> Value {
item.clone()
.follow_cell_path(&[path], false)
.unwrap_or_else(|_| item.clone())
.unwrap_or_else(|_| unknown_error_value())
}
item => item.clone(),
}
@ -220,3 +220,7 @@ pub fn map_into_value(hm: HashMap<String, Value>) -> Value {
pub fn nu_str<S: AsRef<str>>(s: S) -> Value {
Value::string(s.as_ref().to_owned(), NuSpan::unknown())
}
fn unknown_error_value() -> Value {
Value::string(String::from(""), NuSpan::unknown())
}