mirror of
https://github.com/aljazceru/turso.git
synced 2026-02-23 00:45:37 +01:00
Merge 'Minor: use use_eq_ignore_ascii_case in some places' from Anton Harniakou
Use `eq_ignore_ascii_case` because it's cooler 😎 than `x.to_lowercase() == y.to_lowercase()`. Closes #1678
This commit is contained in:
@@ -425,8 +425,8 @@ impl Limbo {
|
||||
};
|
||||
// TODO this is a quickfix. Some ideas to do case insensitive comparisons is to use
|
||||
// Uncased or Unicase.
|
||||
let temp = input.to_lowercase();
|
||||
if temp.trim_start().starts_with("explain") {
|
||||
let explain_str = "explain";
|
||||
if input.trim_start()[0..explain_str.len()].eq_ignore_ascii_case(explain_str) {
|
||||
match self.conn.query(input) {
|
||||
Ok(Some(stmt)) => {
|
||||
let _ = self.writeln(stmt.explain().as_bytes());
|
||||
|
||||
@@ -46,7 +46,7 @@ pub fn translate_pragma(
|
||||
program.extend(&opts);
|
||||
let mut write = false;
|
||||
|
||||
if name.name.0.to_lowercase() == "pragma_list" {
|
||||
if name.name.0.eq_ignore_ascii_case("pragma_list") {
|
||||
list_pragmas(&mut program);
|
||||
return Ok(program);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user