Skip to content

Commit

Permalink
clippy fixes
Browse files Browse the repository at this point in the history
  • Loading branch information
NSoiffer committed Feb 14, 2023
1 parent dfa9944 commit 6fda4f3
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 1 deletion.
1 change: 1 addition & 0 deletions src/chemistry.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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" {
Expand Down
2 changes: 1 addition & 1 deletion src/interface.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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() {
Expand Down

0 comments on commit 6fda4f3

Please sign in to comment.