panic -> Err

This commit is contained in:
Cole Helbling 2023-07-05 12:00:43 -07:00
parent da4c503608
commit 2a870c3bfe

View File

@ -174,7 +174,7 @@ impl<'de> Deserialize<'de> for FlakeLock {
let mut root_nodes = HashMap::new();
let root_node = &nodes[&root];
let Node::Root(root_node) = root_node else {
panic!("root node was not a Root node, but was a {} node", root_node.variant());
return Err(de::Error::custom(format!("root node was not a Root node, but was a {} node", root_node.variant())));
};
for (root_name, root_reference) in root_node.inputs.iter() {
let node_keys: Vec<String> = match root_reference {