Skip to content

Commit 72036e4

Browse files
authored
Update mod.rs
1 parent 1abbdc5 commit 72036e4

File tree

1 file changed

+6
-10
lines changed

1 file changed

+6
-10
lines changed

src/pg/mod.rs

Lines changed: 6 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -11,8 +11,8 @@ use crate::stmt_cache::{PrepareCallback, StmtCache};
1111
use crate::{AnsiTransactionManager, AsyncConnection, SimpleAsyncConnection};
1212
use diesel::connection::statement_cache::{PrepareForCache, StatementCacheKey};
1313
use diesel::pg::{
14-
FailedToLookupTypeError, Pg, PgMetadataCache, PgMetadataCacheKey, PgMetadataLookup,
15-
PgQueryBuilder, PgTypeMetadata,
14+
Pg, PgMetadataCache, PgMetadataCacheKey, PgMetadataLookup, PgQueryBuilder,
15+
PgTypeMetadata,
1616
};
1717
use diesel::query_builder::bind_collector::RawBytesBindCollector;
1818
use diesel::query_builder::{AsQuery, QueryBuilder, QueryFragment, QueryId};
@@ -383,11 +383,11 @@ impl AsyncPgConnection {
383383

384384
let fake_oid_locations = std::iter::zip(bind_collector_0.binds, bind_collector_1.binds)
385385
.enumerate()
386-
.flat_map(|(bind_index, (bytes_0, bytes_1))|) {
386+
.flat_map(|(bind_index, (bytes_0, bytes_1))| {
387387
std::iter::zip(bytes_0.unwrap_or_default(), bytes_1.unwrap_or_default())
388388
.enumerate()
389389
.filter_map(|(byte_index, bytes)| (bytes == (0, 1)).then_some((bind_index, byte_index)))
390-
}
390+
})
391391
// Avoid storing the bind collectors in the returned Future
392392
.collect::<Vec<_>>();
393393

@@ -526,10 +526,6 @@ impl PgAsyncMetadataLookup {
526526

527527
impl PgMetadataLookup for PgAsyncMetadataLookup {
528528
fn lookup_type(&mut self, type_name: &str, schema: Option<&str>) -> PgTypeMetadata {
529-
let cache_key =
530-
PgMetadataCacheKey::new(schema.map(Cow::Borrowed), Cow::Borrowed(type_name));
531-
532-
let cache_key = cache_key.into_owned();
533529
let index = self.unresolved_types.len();
534530
self.unresolved_types
535531
.push((schema.map(ToOwned::to_owned), type_name.to_owned()));
@@ -582,9 +578,9 @@ async fn lookup_type(
582578
}
583579

584580
fn replace_fake_oid(
585-
binds: &mut Vec<Option<Vec<u8>>>,
581+
binds: &mut [Option<Vec<u8>>],
586582
real_oids: HashMap<u32, u32>,
587-
(bind_index, byte_index): (u32, u32),
583+
(bind_index, byte_index): (usize, usize),
588584
) -> Option<()> {
589585
let serialized_oid = binds
590586
.get_mut(bind_index)?

0 commit comments

Comments
 (0)