Skip to content

Commit

Permalink
style: improve simple_query
Browse files Browse the repository at this point in the history
  • Loading branch information
MichaelKreil committed Oct 24, 2024
1 parent be80b61 commit 2f5c18c
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions versatiles_container/src/container/mbtiles/reader.rs
Original file line number Diff line number Diff line change
Expand Up @@ -177,11 +177,11 @@ impl MBTilesReader {
///
/// # Errors
/// Returns an error if there is an issue executing the query.
fn simple_query(&self, sql1: &str, sql2: &str) -> Result<i32> {
let sql = if sql2.is_empty() {
format!("SELECT {sql1} FROM tiles")
fn simple_query(&self, sql_value: &str, sql_where: &str) -> Result<i32> {
let sql = if sql_where.is_empty() {
format!("SELECT {sql_value} FROM tiles")
} else {
format!("SELECT {sql1} FROM tiles WHERE {sql2}")
format!("SELECT {sql_value} FROM tiles WHERE {sql_where}")
};

trace!("SQL: {}", sql);
Expand Down

0 comments on commit 2f5c18c

Please sign in to comment.