diff --git a/crates/core/src/v2/hrana.rs b/crates/core/src/v2/hrana.rs index 517700365f..1a8a6018f7 100644 --- a/crates/core/src/v2/hrana.rs +++ b/crates/core/src/v2/hrana.rs @@ -14,7 +14,7 @@ use hyper_rustls::{HttpsConnector, HttpsConnectorBuilder}; // use crate::client::Config; use crate::{Column, Params, Result}; -use std::collections::HashMap; +use std::collections::{HashMap, VecDeque}; use std::sync::atomic::{AtomicI64, Ordering}; use std::sync::{Arc, RwLock}; @@ -357,12 +357,12 @@ impl super::statement::Stmt for Statement { pub struct Rows { cols: Arc>, - rows: Vec>, + rows: VecDeque>, } impl RowsInner for Rows { fn next(&mut self) -> Result> { - let row = match self.rows.pop() { + let row = match self.rows.pop_front() { Some(row) => Row { cols: self.cols.clone(), inner: row, diff --git a/crates/core/src/v2/hrana/proto.rs b/crates/core/src/v2/hrana/proto.rs index c94fde93c3..037195cddb 100644 --- a/crates/core/src/v2/hrana/proto.rs +++ b/crates/core/src/v2/hrana/proto.rs @@ -4,6 +4,7 @@ #![allow(dead_code)] use std::fmt; +use std::collections::VecDeque; use serde::{Deserialize, Serialize}; @@ -107,7 +108,7 @@ pub struct NamedArg { #[derive(Deserialize, Clone, Debug)] pub struct StmtResult { pub cols: Vec, - pub rows: Vec>, + pub rows: VecDeque>, pub affected_row_count: u64, #[serde(with = "option_i64_as_str")] pub last_insert_rowid: Option,