Skip to content

Commit 3dfc305

Browse files
committed
fix: use same fix for the same cast in Migrate::apply() everywhere
1 parent 6c9feb1 commit 3dfc305

File tree

2 files changed

+3
-3
lines changed

2 files changed

+3
-3
lines changed

sqlx-mysql/src/migrate.rs

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -224,16 +224,15 @@ CREATE TABLE IF NOT EXISTS _sqlx_migrations (
224224

225225
let elapsed = start.elapsed();
226226

227+
#[allow(clippy::cast_possible_truncation)]
227228
let _ = query(
228229
r#"
229230
UPDATE _sqlx_migrations
230231
SET execution_time = ?
231232
WHERE version = ?
232233
"#,
233234
)
234-
// Unlikely unless the execution time exceeds ~292 years,
235-
// then we're probably okay losing that information.
236-
.bind(i64::try_from(elapsed.as_nanos()).ok())
235+
.bind(elapsed.as_nanos() as i64)
237236
.bind(migration.version)
238237
.execute(self)
239238
.await?;

sqlx-sqlite/src/migrate.rs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -168,6 +168,7 @@ CREATE TABLE IF NOT EXISTS _sqlx_migrations (
168168
let elapsed = start.elapsed();
169169

170170
// language=SQL
171+
#[allow(clippy::cast_possible_truncation)]
171172
let _ = query(
172173
r#"
173174
UPDATE _sqlx_migrations

0 commit comments

Comments
 (0)