Skip to content

Commit e14015b

Browse files
author
system
committed
Clippy Fixes rwf-admin
1 parent 7c7fc8b commit e14015b

1 file changed

Lines changed: 4 additions & 3 deletions

File tree

rwf-admin/src/controllers/models.rs

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -62,12 +62,13 @@ impl PageController for ModelController {
6262
let table_name = model.clone();
6363
let rows = Pool::pool()
6464
.with_connection(|mut conn| async move {
65+
let offset = format!(" OFFSET {}", (page - 1) * 25);
6566
Row::find_by_sql(
6667
format!(
6768
"SELECT * FROM \"{}\" {}LIMIT 25{}",
6869
table_name.escape(),
6970
order_by,
70-
format!(" OFFSET {}", (page - 1) * 25),
71+
offset
7172
),
7273
&[],
7374
)
@@ -79,10 +80,10 @@ impl PageController for ModelController {
7980
for row in rows {
8081
data.push(row.values()?);
8182
}
82-
83+
let title = format!("{} | Rust Web Framework", model);
8384
render!(request,
8485
"templates/rwf_admin/model.html",
85-
"title" => format!("{} | Rust Web Framework", model),
86+
"title" => title,
8687
"table_name" => model,
8788
"columns" => columns,
8889
"rows" => data,

0 commit comments

Comments
 (0)