tidy up variable naming
This commit is contained in:
parent
6866215a8a
commit
eaa2745d4b
|
@ -243,13 +243,13 @@ struct Torrent {
|
||||||
fn torrent_search(
|
fn torrent_search(
|
||||||
conn: r2d2::PooledConnection<SqliteConnectionManager>,
|
conn: r2d2::PooledConnection<SqliteConnectionManager>,
|
||||||
query: &str,
|
query: &str,
|
||||||
key: SortKey,
|
sort_key: SortKey,
|
||||||
direction: SortDirection,
|
sort_dir: SortDirection,
|
||||||
size: usize,
|
size: usize,
|
||||||
offset: usize,
|
offset: usize,
|
||||||
) -> Result<Vec<Torrent>, Error> {
|
) -> Result<Vec<Torrent>, Error> {
|
||||||
// `key` and `direction` are already sanitized and should not be escaped:
|
// `sort_key` and `sort_dir` are already sanitized and should not be escaped:
|
||||||
let stmt_str = format!("select * from torrents where name like '%' || ?1 || '%' order by {} {} limit ?2, ?3", key, direction);
|
let stmt_str = format!("select * from torrents where name like '%' || ?1 || '%' order by {} {} limit ?2, ?3", sort_key, sort_dir);
|
||||||
let mut stmt = conn.prepare(&stmt_str)?;
|
let mut stmt = conn.prepare(&stmt_str)?;
|
||||||
|
|
||||||
let torrent_iter = stmt.query_map(params!{
|
let torrent_iter = stmt.query_map(params!{
|
||||||
|
|
Loading…
Reference in New Issue