Skip to content

Commit 0d8b83c

Browse files
committed
Update format! generated code for the latest Rust versions
1 parent bf5cef5 commit 0d8b83c

File tree

3 files changed

+18
-27
lines changed

3 files changed

+18
-27
lines changed

tests/expand/boolean.expanded.rs

Lines changed: 6 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -28,13 +28,12 @@ impl QueryStats {
2828
});
2929
}
3030
let sql = ::alloc::__export::must_use({
31-
let res = ::alloc::fmt::format(
31+
::alloc::fmt::format(
3232
format_args!(
3333
"SELECT * FROM {0} WHERE {1}", "query_stats",
3434
"database_id = ANY($1)",
3535
),
36-
);
37-
res
36+
)
3837
});
3938
let mut results = Vec::new();
4039
for row in db.query(&db.prepare_cached(&sql).await?, &[&database_id]).await? {
@@ -65,13 +64,12 @@ impl QueryStats {
6564
});
6665
}
6766
let sql = ::alloc::__export::must_use({
68-
let res = ::alloc::fmt::format(
67+
::alloc::fmt::format(
6968
format_args!(
7069
"DELETE FROM {0} WHERE {1} RETURNING *", "query_stats",
7170
"database_id = ANY($1)",
7271
),
73-
);
74-
res
72+
)
7573
});
7674
let mut results = Vec::new();
7775
for row in db.query(&db.prepare_cached(&sql).await?, &[&database_id]).await? {
@@ -123,13 +121,12 @@ impl QueryStats {
123121
grouped_rows.entry((row.database_id,)).or_default().push(row);
124122
}
125123
let sql = ::alloc::__export::must_use({
126-
let res = ::alloc::fmt::format(
124+
::alloc::fmt::format(
127125
format_args!(
128126
"COPY {0} ({1}) FROM STDIN BINARY", "query_stats",
129127
"database_id, toplevel, calls",
130128
),
131-
);
132-
res
129+
)
133130
});
134131
let types = &[
135132
tokio_postgres::types::Type::INT8,

tests/expand/float_round.expanded.rs

Lines changed: 6 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -28,13 +28,12 @@ impl QueryStats {
2828
});
2929
}
3030
let sql = ::alloc::__export::must_use({
31-
let res = ::alloc::fmt::format(
31+
::alloc::fmt::format(
3232
format_args!(
3333
"SELECT * FROM {0} WHERE {1}", "query_stats",
3434
"database_id = ANY($1)",
3535
),
36-
);
37-
res
36+
)
3837
});
3938
let mut results = Vec::new();
4039
for row in db.query(&db.prepare_cached(&sql).await?, &[&database_id]).await? {
@@ -65,13 +64,12 @@ impl QueryStats {
6564
});
6665
}
6766
let sql = ::alloc::__export::must_use({
68-
let res = ::alloc::fmt::format(
67+
::alloc::fmt::format(
6968
format_args!(
7069
"DELETE FROM {0} WHERE {1} RETURNING *", "query_stats",
7170
"database_id = ANY($1)",
7271
),
73-
);
74-
res
72+
)
7573
});
7674
let mut results = Vec::new();
7775
for row in db.query(&db.prepare_cached(&sql).await?, &[&database_id]).await? {
@@ -124,13 +122,12 @@ impl QueryStats {
124122
grouped_rows.entry((row.database_id,)).or_default().push(row);
125123
}
126124
let sql = ::alloc::__export::must_use({
127-
let res = ::alloc::fmt::format(
125+
::alloc::fmt::format(
128126
format_args!(
129127
"COPY {0} ({1}) FROM STDIN BINARY", "query_stats",
130128
"database_id, calls, total_time",
131129
),
132-
);
133-
res
130+
)
134131
});
135132
let types = &[
136133
tokio_postgres::types::Type::INT8,

tests/expand/query_stats.expanded.rs

Lines changed: 6 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -51,13 +51,12 @@ impl QueryStats {
5151
});
5252
}
5353
let sql = ::alloc::__export::must_use({
54-
let res = ::alloc::fmt::format(
54+
::alloc::fmt::format(
5555
format_args!(
5656
"SELECT * FROM {0} WHERE {1}", "query_stats",
5757
"database_id = ANY($1) AND end_at >= $2 AND start_at <= $3",
5858
),
59-
);
60-
res
59+
)
6160
});
6261
let mut results = Vec::new();
6362
for row in db
@@ -109,13 +108,12 @@ impl QueryStats {
109108
});
110109
}
111110
let sql = ::alloc::__export::must_use({
112-
let res = ::alloc::fmt::format(
111+
::alloc::fmt::format(
113112
format_args!(
114113
"DELETE FROM {0} WHERE {1} RETURNING *", "query_stats",
115114
"database_id = ANY($1) AND end_at >= $2 AND start_at <= $3",
116115
),
117-
);
118-
res
116+
)
119117
});
120118
let mut results = Vec::new();
121119
for row in db
@@ -258,13 +256,12 @@ impl QueryStats {
258256
grouped_rows.entry((row.database_id,)).or_default().push(row);
259257
}
260258
let sql = ::alloc::__export::must_use({
261-
let res = ::alloc::fmt::format(
259+
::alloc::fmt::format(
262260
format_args!(
263261
"COPY {0} ({1}) FROM STDIN BINARY", "query_stats",
264262
"database_id, start_at, end_at, collected_at, collected_secs, fingerprint, postgres_role_id, calls, rows, total_time, io_time, shared_blks_hit, shared_blks_read",
265263
),
266-
);
267-
res
264+
)
268265
});
269266
let types = &[
270267
tokio_postgres::types::Type::INT8,

0 commit comments

Comments
 (0)