@@ -11,8 +11,8 @@ use crate::stmt_cache::{PrepareCallback, StmtCache};
11
11
use crate :: { AnsiTransactionManager , AsyncConnection , SimpleAsyncConnection } ;
12
12
use diesel:: connection:: statement_cache:: { PrepareForCache , StatementCacheKey } ;
13
13
use diesel:: pg:: {
14
- FailedToLookupTypeError , Pg , PgMetadataCache , PgMetadataCacheKey , PgMetadataLookup ,
15
- PgQueryBuilder , PgTypeMetadata ,
14
+ Pg , PgMetadataCache , PgMetadataCacheKey , PgMetadataLookup , PgQueryBuilder ,
15
+ PgTypeMetadata ,
16
16
} ;
17
17
use diesel:: query_builder:: bind_collector:: RawBytesBindCollector ;
18
18
use diesel:: query_builder:: { AsQuery , QueryBuilder , QueryFragment , QueryId } ;
@@ -383,11 +383,11 @@ impl AsyncPgConnection {
383
383
384
384
let fake_oid_locations = std:: iter:: zip ( bind_collector_0. binds , bind_collector_1. binds )
385
385
. enumerate ( )
386
- . flat_map ( |( bind_index, ( bytes_0, bytes_1) ) |) {
386
+ . flat_map ( |( bind_index, ( bytes_0, bytes_1) ) | {
387
387
std:: iter:: zip ( bytes_0. unwrap_or_default ( ) , bytes_1. unwrap_or_default ( ) )
388
388
. enumerate ( )
389
389
. filter_map ( |( byte_index, bytes) | ( bytes == ( 0 , 1 ) ) . then_some ( ( bind_index, byte_index) ) )
390
- }
390
+ } )
391
391
// Avoid storing the bind collectors in the returned Future
392
392
. collect :: < Vec < _ > > ( ) ;
393
393
@@ -526,10 +526,6 @@ impl PgAsyncMetadataLookup {
526
526
527
527
impl PgMetadataLookup for PgAsyncMetadataLookup {
528
528
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 ( ) ;
533
529
let index = self . unresolved_types . len ( ) ;
534
530
self . unresolved_types
535
531
. push ( ( schema. map ( ToOwned :: to_owned) , type_name. to_owned ( ) ) ) ;
@@ -582,9 +578,9 @@ async fn lookup_type(
582
578
}
583
579
584
580
fn replace_fake_oid (
585
- binds : & mut Vec < Option < Vec < u8 > > > ,
581
+ binds : & mut [ Option < Vec < u8 > > ] ,
586
582
real_oids : HashMap < u32 , u32 > ,
587
- ( bind_index, byte_index) : ( u32 , u32 ) ,
583
+ ( bind_index, byte_index) : ( usize , usize ) ,
588
584
) -> Option < ( ) > {
589
585
let serialized_oid = binds
590
586
. get_mut ( bind_index) ?
0 commit comments