Skip to content

Commit

Permalink
store: Remove unused ToSql/FromSql impls for AdaptiveBatchSize
Browse files Browse the repository at this point in the history
  • Loading branch information
lutter committed Feb 11, 2025
1 parent 05513d9 commit ff607b0
Showing 1 changed file with 0 additions and 19 deletions.
19 changes: 0 additions & 19 deletions store/postgres/src/vid_batcher.rs
Original file line number Diff line number Diff line change
@@ -1,9 +1,6 @@
use std::time::{Duration, Instant};

use diesel::{
deserialize::FromSql,
pg::Pg,
serialize::{Output, ToSql},
sql_query,
sql_types::{BigInt, Integer},
PgConnection, RunQueryDsl as _,
Expand Down Expand Up @@ -62,22 +59,6 @@ impl AdaptiveBatchSize {
}
}

impl ToSql<BigInt, Pg> for AdaptiveBatchSize {
fn to_sql<'b>(&'b self, out: &mut Output<'b, '_, Pg>) -> diesel::serialize::Result {
<i64 as ToSql<BigInt, Pg>>::to_sql(&self.size, out)
}
}

impl FromSql<BigInt, Pg> for AdaptiveBatchSize {
fn from_sql(bytes: diesel::pg::PgValue) -> diesel::deserialize::Result<Self> {
let size = <i64 as FromSql<BigInt, Pg>>::from_sql(bytes)?;
Ok(AdaptiveBatchSize {
size,
target: ENV_VARS.store.batch_target_duration,
})
}
}

/// A timer that works like `std::time::Instant` in non-test code, but
/// returns a fake elapsed value in tests
struct Timer {
Expand Down

0 comments on commit ff607b0

Please sign in to comment.