forked from extern/nushell
nu-engine: deserialize_struct: fix missing conversion from string to column path (#3048)
This commit is contained in:
parent
abd2632977
commit
617341f8d5
@ -4,6 +4,7 @@ use nu_protocol::{
|
|||||||
hir::CapturedBlock, CallInfo, ColumnPath, Primitive, RangeInclusion, ShellTypeName,
|
hir::CapturedBlock, CallInfo, ColumnPath, Primitive, RangeInclusion, ShellTypeName,
|
||||||
UntaggedValue, Value,
|
UntaggedValue, Value,
|
||||||
};
|
};
|
||||||
|
use nu_source::Span;
|
||||||
use nu_source::{HasSpan, Spanned, SpannedItem, Tagged, TaggedItem};
|
use nu_source::{HasSpan, Spanned, SpannedItem, Tagged, TaggedItem};
|
||||||
use nu_value_ext::ValueExt;
|
use nu_value_ext::ValueExt;
|
||||||
use serde::de;
|
use serde::de;
|
||||||
@ -401,6 +402,13 @@ impl<'de, 'a> de::Deserializer<'de> for &'a mut ConfigDeserializer<'de> {
|
|||||||
value: UntaggedValue::Primitive(Primitive::ColumnPath(path)),
|
value: UntaggedValue::Primitive(Primitive::ColumnPath(path)),
|
||||||
..
|
..
|
||||||
} => path,
|
} => path,
|
||||||
|
Value {
|
||||||
|
value: UntaggedValue::Primitive(Primitive::String(path)),
|
||||||
|
..
|
||||||
|
} => {
|
||||||
|
let s = path.spanned(Span::unknown());
|
||||||
|
ColumnPath::build(&s)
|
||||||
|
}
|
||||||
other => {
|
other => {
|
||||||
return Err(ShellError::type_error(
|
return Err(ShellError::type_error(
|
||||||
"column path",
|
"column path",
|
||||||
|
Loading…
Reference in New Issue
Block a user