From d53b9e1e1f88464e3c8011240c475c4c4ee0ca6e Mon Sep 17 00:00:00 2001 From: Tom Alexander Date: Mon, 2 Oct 2023 19:22:35 -0400 Subject: [PATCH] Fix get_property. This was returning the error when a token was not an atom whereas we only wanted to check to see if it was the atom nil. --- src/compare/util.rs | 7 ++----- 1 file changed, 2 insertions(+), 5 deletions(-) diff --git a/src/compare/util.rs b/src/compare/util.rs index 4c2578d..ff3c471 100644 --- a/src/compare/util.rs +++ b/src/compare/util.rs @@ -184,11 +184,8 @@ pub(crate) fn get_property<'b, 's, 'x>( .ok_or("Should have an attributes child.")?; let attributes_map = attributes_child.as_map()?; let prop = attributes_map.get(key).map(|token| *token); - match prop - .map(|token| token.as_atom()) - .map_or(Ok(None), |r| r.map(Some))? - { - Some("nil") => return Ok(None), + match prop.map(|token| token.as_atom()) { + Some(Ok("nil")) => return Ok(None), _ => {} }; Ok(prop)