diff --git a/src/xml_parsing/variable_update_fn_parser.rs b/src/xml_parsing/variable_update_fn_parser.rs index abc5d3a..e9f4a77 100644 --- a/src/xml_parsing/variable_update_fn_parser.rs +++ b/src/xml_parsing/variable_update_fn_parser.rs @@ -117,11 +117,9 @@ fn process_output_var_name_item, BR: BufRead>( } }); - let item = qualitative_species - .next() - .ok_or(XmlReadingError::NoSuchAttribute( - "value after qualitativeSpecies".to_string(), - ))?; + let item = qualitative_species.next().ok_or_else(|| { + XmlReadingError::NoSuchAttribute("value after qualitativeSpecies".to_string()) + })?; expect_closure_of(xml, "output")?;