Fix async tests

This commit is contained in:
Daniel Akhterov 2019-07-31 21:26:15 -07:00
parent b731dbe90f
commit 23d13adb12
2 changed files with 7 additions and 5 deletions

View File

@ -31,13 +31,15 @@ impl<'a> DeContext<'a> {
pub async fn next_packet(&mut self) -> Result<(), failure::Error> {
if let Some(stream) = &mut self.stream {
println!("Called next packet");
self.decoder = Decoder::new(stream.next_packet().await?);
Ok(())
} else {
failure::bail!("Calling next_packet on DeContext with no stream provided")
return Ok(());
} else if self.decoder.buf.len() > 0 {
// There is still data in the buffer
return Ok(())
}
failure::bail!("Calling next_packet on DeContext with no stream provided")
}
}

View File

@ -1,4 +1,4 @@
use crate::mariadb::{DeContext, Deserialize, ComStmtPrepareOk, ColumnDefPacket, Capabilities, EofPacket};
use crate::mariadb::{Framed, DeContext, Deserialize, ComStmtPrepareOk, ColumnDefPacket, Capabilities, EofPacket};
#[derive(Debug, Default)]
pub struct ComStmtPrepareResp {