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.
This commit is contained in:
Tom Alexander 2023-10-02 19:22:35 -04:00
parent 5c929ffc13
commit d53b9e1e1f
Signed by: talexander
GPG Key ID: D3A179C9A53C0EDE
1 changed files with 2 additions and 5 deletions

View File

@ -184,11 +184,8 @@ pub(crate) fn get_property<'b, 's, 'x>(
.ok_or("Should have an attributes child.")?; .ok_or("Should have an attributes child.")?;
let attributes_map = attributes_child.as_map()?; let attributes_map = attributes_child.as_map()?;
let prop = attributes_map.get(key).map(|token| *token); let prop = attributes_map.get(key).map(|token| *token);
match prop match prop.map(|token| token.as_atom()) {
.map(|token| token.as_atom()) Some(Ok("nil")) => return Ok(None),
.map_or(Ok(None), |r| r.map(Some))?
{
Some("nil") => return Ok(None),
_ => {} _ => {}
}; };
Ok(prop) Ok(prop)