mirror of
https://github.com/launchbadge/sqlx.git
synced 2026-03-27 13:46:32 +00:00
Replace some futures_util APIs with std variants (#3721)
This commit is contained in:
@@ -16,7 +16,7 @@ use sqlx_core::database::Database;
|
||||
use sqlx_core::describe::Describe;
|
||||
use sqlx_core::executor::Executor;
|
||||
use sqlx_core::transaction::TransactionManager;
|
||||
use std::future;
|
||||
use std::{future, pin::pin};
|
||||
|
||||
sqlx_core::declare_driver_with_optional_migrate!(DRIVER = MySql);
|
||||
|
||||
@@ -113,8 +113,7 @@ impl AnyConnectionBackend for MySqlConnection {
|
||||
|
||||
Box::pin(async move {
|
||||
let arguments = arguments?;
|
||||
let stream = self.run(query, arguments, persistent).await?;
|
||||
futures_util::pin_mut!(stream);
|
||||
let mut stream = pin!(self.run(query, arguments, persistent).await?);
|
||||
|
||||
while let Some(result) = stream.try_next().await? {
|
||||
if let Either::Right(row) = result {
|
||||
|
||||
@@ -21,8 +21,8 @@ use either::Either;
|
||||
use futures_core::future::BoxFuture;
|
||||
use futures_core::stream::BoxStream;
|
||||
use futures_core::Stream;
|
||||
use futures_util::{pin_mut, TryStreamExt};
|
||||
use std::{borrow::Cow, sync::Arc};
|
||||
use futures_util::TryStreamExt;
|
||||
use std::{borrow::Cow, pin::pin, sync::Arc};
|
||||
|
||||
impl MySqlConnection {
|
||||
async fn prepare_statement<'c>(
|
||||
@@ -263,8 +263,7 @@ impl<'c> Executor<'c> for &'c mut MySqlConnection {
|
||||
|
||||
Box::pin(try_stream! {
|
||||
let arguments = arguments?;
|
||||
let s = self.run(sql, arguments, persistent).await?;
|
||||
pin_mut!(s);
|
||||
let mut s = pin!(self.run(sql, arguments, persistent).await?);
|
||||
|
||||
while let Some(v) = s.try_next().await? {
|
||||
r#yield!(v);
|
||||
|
||||
Reference in New Issue
Block a user