From 8b3cd1ed81fc1c9137ef84a1dc04ca14f7fe9f12 Mon Sep 17 00:00:00 2001 From: kirbylife Date: Thu, 25 Mar 2021 19:03:05 -0600 Subject: [PATCH] makes clippy happy --- src/lib.rs | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/lib.rs b/src/lib.rs index 2acf6bf..41fa070 100644 --- a/src/lib.rs +++ b/src/lib.rs @@ -72,8 +72,8 @@ pub fn cssifier>(xpath: S) -> Option { format!(".{}", mvalue.replace(" ", ".")) } else if mattr == "text()" || mattr == "." { format!(":contains(^{}$)", mvalue) - } else if mattr != "" { - let new_mvalue = if mvalue.find(" ").is_some() { + } else if !mattr.is_empty() { + let new_mvalue = if mvalue.contains(' ') { format!("\"{}\"", mvalue) } else { mvalue.to_string() @@ -86,7 +86,7 @@ pub fn cssifier>(xpath: S) -> Option { let cattr = node.name("cattr")?.as_str(); let cvalue = node.name("cvalue")?.as_str(); - if cattr.starts_with("@") { + if cattr.starts_with('@') { format!("[{}*={}]", cattr.replace("@", ""), cvalue) } else if cattr == "text()" { format!(":contains({})", cvalue)