From eaa2745d4bf9a8f96ddfaabaa6a6f2b63a26d222 Mon Sep 17 00:00:00 2001 From: Rob Watson Date: Fri, 3 Jul 2020 12:44:07 +0200 Subject: [PATCH] tidy up variable naming --- server/service/src/main.rs | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/server/service/src/main.rs b/server/service/src/main.rs index 3316d0c..4354977 100644 --- a/server/service/src/main.rs +++ b/server/service/src/main.rs @@ -243,13 +243,13 @@ struct Torrent { fn torrent_search( conn: r2d2::PooledConnection, query: &str, - key: SortKey, - direction: SortDirection, + sort_key: SortKey, + sort_dir: SortDirection, size: usize, offset: usize, ) -> Result, Error> { - // `key` and `direction` 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); + // `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", sort_key, sort_dir); let mut stmt = conn.prepare(&stmt_str)?; let torrent_iter = stmt.query_map(params!{