diff --git a/src/chemistry.rs b/src/chemistry.rs index 7f5c0301..677297ec 100644 --- a/src/chemistry.rs +++ b/src/chemistry.rs @@ -1215,6 +1215,7 @@ fn likely_chem_formula_operator(mathml: Element) -> isize { fn is_legal_triple_bond(left: &str, right: &str) -> bool { // from en.wikipedia.org/wiki/Triple_bond // 'B' is from studiousguy.com/triple-bond-examples/ + #![allow(clippy::if_same_then_else)] if left=="C" && (right == "C" || right == "N" || right == "O") { return true; } else if left == "B" && right == "B" { diff --git a/src/interface.rs b/src/interface.rs index 13b6398c..aa67c321 100644 --- a/src/interface.rs +++ b/src/interface.rs @@ -460,7 +460,7 @@ pub fn trim_element(e: &Element) { // hack to avoid non-breaking whitespace from being removed -- move to a unique non-whitespace char then back let trimmed_text = single_text.replace(' ', TEMP_NBSP).trim().replace(TEMP_NBSP, " "); - if !(is_leaf(*e) || name(&e) == "intent-literal") && !single_text.is_empty() { // intent-literal comes from testing intent + if !(is_leaf(*e) || name(e) == "intent-literal" || single_text.is_empty()) { // intent-literal comes from testing intent // FIX: we have a problem -- what should happen??? // FIX: For now, just keep the children and ignore the text and log an error -- shouldn't panic/crash if !trimmed_text.is_empty() {