Skip to content
This repository has been archived by the owner on Apr 11, 2018. It is now read-only.

Commit

Permalink
[lint] remove unnecessary boolean not
Browse files Browse the repository at this point in the history
  • Loading branch information
kesselborn committed Jan 12, 2017
1 parent c28117d commit c482d02
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 3 deletions.
1 change: 1 addition & 0 deletions pre-commit
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
#!/bin/bash -xe
test "$(grep --max-count 1 version Cargo.toml)" = "$(grep --max-count 1 version Cargo.lock)"
find src/ -name "*.rs" -exec touch {} \;
rustup run nightly cargo clippy -- -W filter_map -W indexing_slicing -W if_not_else -W items_after_statements -W mut_mut -W non_ascii_literal -W nonminimal_bool -W option_map_unwrap_or -W option_map_unwrap_or_else -W option_unwrap_used -W pub_enum_variant_names -W result_unwrap_used -W shadow_reuse -W shadow_same -W shadow_unrelated -W similar_names -W single_match_else -W string_add -W string_add_assign -W stutter -W unicode_not_nfc -W unseparated_literal_suffix -W use_debug -W used_underscore_binding -W wrong_pub_self_convention
6 changes: 3 additions & 3 deletions src/dom/parser.rs
Original file line number Diff line number Diff line change
Expand Up @@ -183,15 +183,15 @@ fn get_text(h: &Handle) -> Option<String> {
}

// adjust extracted text: mainly remove white space and some unicode characters
if !text_tokens.is_empty() {
if text_tokens.is_empty() {
None
} else {
Some(String::from(text_tokens.join(" ").trim())
.replace("\u{a0}", "")
.replace(" >", ">")
.replace(" <", "<")
.replace(" ::", "::")
.replace(":: ", "::")
.replace(" ", " "))
} else {
None
}
}

0 comments on commit c482d02

Please sign in to comment.