improve data hashmap retrieval handling
This commit is contained in:
parent
bbf8659587
commit
2531b4ac0d
|
@ -158,10 +158,7 @@ impl Writer {
|
|||
|
||||
fn parse_id(&mut self, node: &Node) -> Result<()> {
|
||||
if let NodeOp::Id(id) = &node.op {
|
||||
let data_rec = match self.data.get(id) {
|
||||
Some(rec) => rec,
|
||||
None => return Err(Error::NotDefined),
|
||||
};
|
||||
let data_rec = self.data.get(id).ok_or(Error::NotDefined)?;
|
||||
|
||||
let data = Node::new(
|
||||
node.op.clone(),
|
||||
|
|
Loading…
Reference in New Issue