mirror of
https://github.com/nushell/nushell.git
synced 2025-05-29 14:21:45 +02:00
Fix setting configuration params
Fixes #627 Fixes a regression caused by #579, specifically commit cc8872b4eec3f39896ccb11d9c25a30a79c04dd7 . The code was intended to perform a comparison between the wanted output type and "Tagged<Value>" in order to be able to provide a special-cased path for Tagged<Value>. When I wrote the code, I used "name" as a variable name and only later realized that it shadowed the "name" param to the function, so I renamed it to type_name, but forgot to change the comparison. This broke the special-casing, as the name param only contains the name of the struct without generics (like "Tagged"), while `std::any::type_name` (in the current implementation) contains the full paths of the struct including all generic params (like "nu::object::meta::Tagged<nu::object::base::Value>").
This commit is contained in:
parent
1878bb8a54
commit
1277bfe0fb
@ -328,7 +328,7 @@ impl<'de, 'a> de::Deserializer<'de> for &'a mut ConfigDeserializer<'de> {
|
||||
let type_name = std::any::type_name::<V::Value>();
|
||||
let tagged_val_name = std::any::type_name::<Tagged<Value>>();
|
||||
|
||||
if name == tagged_val_name {
|
||||
if type_name == tagged_val_name {
|
||||
return visit::<Tagged<Value>, _>(value.val, name, fields, visitor);
|
||||
}
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user