Commit 8bcaee1 1 parent eea95d4 commit 8bcaee1 Copy full SHA for 8bcaee1
File tree 2 files changed +5
-6
lines changed
editoast_derive/src/modelv2/codegen
2 files changed +5
-6
lines changed Original file line number Diff line number Diff line change @@ -39,6 +39,7 @@ impl ToTokens for CreateBatchImpl {
39
39
use diesel:: prelude:: * ;
40
40
use diesel_async:: RunQueryDsl ;
41
41
use futures_util:: stream:: TryStreamExt ;
42
+ let values = values. into_iter( ) . collect:: <Vec <_>>( ) ;
42
43
Ok ( crate :: chunked_for_libpq! {
43
44
#field_count,
44
45
values,
Original file line number Diff line number Diff line change @@ -128,9 +128,8 @@ macro_rules! chunked_for_libpq {
128
128
const ASYNC_SUBDIVISION : usize = 2_usize ;
129
129
const CHUNK_SIZE : usize = LIBPQ_MAX_PARAMETERS / ASYNC_SUBDIVISION / $parameters_per_row;
130
130
let mut result = Vec :: new( ) ;
131
- let values = $values. into_iter( ) . collect:: <Vec <_>>( ) ;
132
- let chunks = values. chunks( CHUNK_SIZE ) ;
133
- for $chunk in chunks. into_iter( ) {
131
+ let chunks = $values. chunks( CHUNK_SIZE ) ;
132
+ for $chunk in chunks {
134
133
let chunk_result = $query;
135
134
result. push( chunk_result) ;
136
135
}
@@ -143,9 +142,8 @@ macro_rules! chunked_for_libpq {
143
142
const ASYNC_SUBDIVISION : usize = 2_usize ;
144
143
const CHUNK_SIZE : usize = LIBPQ_MAX_PARAMETERS / ASYNC_SUBDIVISION / $parameters_per_row;
145
144
let mut result = $result;
146
- let values = $values. into_iter( ) . collect:: <Vec <_>>( ) ;
147
- let chunks = values. chunks( CHUNK_SIZE ) ;
148
- for $chunk in chunks. into_iter( ) {
145
+ let chunks = $values. chunks( CHUNK_SIZE ) ;
146
+ for $chunk in chunks {
149
147
let chunk_result = $query;
150
148
result. extend( chunk_result) ;
151
149
}
You can’t perform that action at this time.
0 commit comments