improve data hashmap retrieval handling

This commit is contained in:
mos 2024-07-28 09:08:28 +02:00
parent bbf8659587
commit 2531b4ac0d
1 changed files with 1 additions and 4 deletions

View File

@ -158,10 +158,7 @@ impl Writer {
fn parse_id(&mut self, node: &Node) -> Result<()> { fn parse_id(&mut self, node: &Node) -> Result<()> {
if let NodeOp::Id(id) = &node.op { if let NodeOp::Id(id) = &node.op {
let data_rec = match self.data.get(id) { let data_rec = self.data.get(id).ok_or(Error::NotDefined)?;
Some(rec) => rec,
None => return Err(Error::NotDefined),
};
let data = Node::new( let data = Node::new(
node.op.clone(), node.op.clone(),