mirror of
https://github.com/ankitects/anki.git
synced 2025-09-25 01:06:35 -04:00
use .eq_ignore_ascii_case() to avoid allocating
This commit is contained in:
parent
68657c7166
commit
dcb2b46d1b
1 changed files with 2 additions and 2 deletions
|
@ -191,9 +191,9 @@ fn unquoted_term(s: &str) -> IResult<&str, Node> {
|
|||
map_res(
|
||||
take_while1(|c| c != ' ' && c != ')'),
|
||||
|text: &str| -> ParseResult<Node> {
|
||||
Ok(if text.len() == 2 && text.to_ascii_lowercase() == "or" {
|
||||
Ok(if text.eq_ignore_ascii_case("or") {
|
||||
Node::Or
|
||||
} else if text.len() == 3 && text.to_ascii_lowercase() == "and" {
|
||||
} else if text.eq_ignore_ascii_case("and") {
|
||||
Node::And
|
||||
} else {
|
||||
Node::Search(search_node_for_text(text)?)
|
||||
|
|
Loading…
Reference in a new issue