makes clippy happy

master
kirbylife 2021-03-25 19:03:05 -06:00
parent 22ebd0780e
commit 8b3cd1ed81
1 changed files with 3 additions and 3 deletions

View File

@ -72,8 +72,8 @@ pub fn cssifier<S: AsRef<str>>(xpath: S) -> Option<String> {
format!(".{}", mvalue.replace(" ", ".")) format!(".{}", mvalue.replace(" ", "."))
} else if mattr == "text()" || mattr == "." { } else if mattr == "text()" || mattr == "." {
format!(":contains(^{}$)", mvalue) format!(":contains(^{}$)", mvalue)
} else if mattr != "" { } else if !mattr.is_empty() {
let new_mvalue = if mvalue.find(" ").is_some() { let new_mvalue = if mvalue.contains(' ') {
format!("\"{}\"", mvalue) format!("\"{}\"", mvalue)
} else { } else {
mvalue.to_string() mvalue.to_string()
@ -86,7 +86,7 @@ pub fn cssifier<S: AsRef<str>>(xpath: S) -> Option<String> {
let cattr = node.name("cattr")?.as_str(); let cattr = node.name("cattr")?.as_str();
let cvalue = node.name("cvalue")?.as_str(); let cvalue = node.name("cvalue")?.as_str();
if cattr.starts_with("@") { if cattr.starts_with('@') {
format!("[{}*={}]", cattr.replace("@", ""), cvalue) format!("[{}*={}]", cattr.replace("@", ""), cvalue)
} else if cattr == "text()" { } else if cattr == "text()" {
format!(":contains({})", cvalue) format!(":contains({})", cvalue)