mirror of
https://github.com/launchbadge/sqlx.git
synced 2026-03-23 10:38:57 +00:00
fix warnings
This commit is contained in:
@@ -366,7 +366,6 @@ impl<DB: Database> DynConnector<DB> {
|
||||
|
||||
pub struct ConnectTask<DB: Database> {
|
||||
handle: JoinHandle<crate::Result<PoolConnection<DB>>>,
|
||||
shared: Arc<ConnectTaskShared>,
|
||||
}
|
||||
|
||||
pub struct ConnectTaskShared {
|
||||
@@ -400,17 +399,7 @@ impl<DB: Database> ConnectTask<DB> {
|
||||
shared.clone(),
|
||||
));
|
||||
|
||||
Self { handle, shared }
|
||||
}
|
||||
|
||||
pub fn cancel(&self) -> Option<Error> {
|
||||
self.shared.cancel_event.notify(1);
|
||||
|
||||
self.shared
|
||||
.last_error
|
||||
.lock()
|
||||
.unwrap_or_else(|e| e.into_inner())
|
||||
.take()
|
||||
Self { handle }
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -2,7 +2,7 @@ use std::fmt::{self, Debug, Formatter};
|
||||
use std::future::{self, Future};
|
||||
use std::io;
|
||||
use std::ops::{Deref, DerefMut};
|
||||
use std::sync::{Arc, Weak};
|
||||
use std::sync::Weak;
|
||||
use std::time::{Duration, Instant};
|
||||
|
||||
use crate::connection::Connection;
|
||||
|
||||
@@ -2,17 +2,11 @@ use crate::ext::future::race;
|
||||
use crate::rt;
|
||||
use crate::sync::{AsyncMutex, AsyncMutexGuardArc};
|
||||
use event_listener::{listener, Event, EventListener, IntoNotification};
|
||||
use futures_util::future::{Fuse, FusedFuture};
|
||||
use futures_util::stream::FuturesUnordered;
|
||||
use futures_util::{FutureExt, StreamExt};
|
||||
use std::cmp;
|
||||
use std::future::Future;
|
||||
use std::ops::{Deref, DerefMut, RangeInclusive, RangeToInclusive};
|
||||
use std::pin::{pin, Pin};
|
||||
use futures_util::StreamExt;
|
||||
use std::ops::{Deref, DerefMut, RangeInclusive};
|
||||
use std::sync::atomic::{AtomicBool, AtomicUsize, Ordering};
|
||||
use std::sync::Arc;
|
||||
use std::task::{ready, Poll};
|
||||
use std::time::Duration;
|
||||
use tracing::Instrument;
|
||||
|
||||
pub struct ConnectionSet<C> {
|
||||
|
||||
@@ -6,7 +6,6 @@ use std::time::{Duration, Instant};
|
||||
|
||||
use cfg_if::cfg_if;
|
||||
use futures_core::Stream;
|
||||
use futures_util::StreamExt;
|
||||
use pin_project_lite::pin_project;
|
||||
|
||||
#[cfg(feature = "_rt-async-io")]
|
||||
@@ -220,7 +219,7 @@ where
|
||||
|
||||
#[inline(always)]
|
||||
fn poll(self: Pin<&mut Self>, cx: &mut Context<'_>) -> Poll<Self::Output> {
|
||||
let mut this = self.project();
|
||||
let this = self.project();
|
||||
|
||||
if let Poll::Ready(out) = this.future.poll(cx) {
|
||||
return Poll::Ready(Some(out));
|
||||
|
||||
@@ -23,7 +23,7 @@ where
|
||||
|
||||
let db_url = env::var("DATABASE_URL").map_err(|e| Error::Configuration(Box::new(e)))?;
|
||||
|
||||
Ok(DB::Connection::connect(&db_url).await?)
|
||||
DB::Connection::connect(&db_url).await
|
||||
}
|
||||
|
||||
// Make a new pool
|
||||
|
||||
Reference in New Issue
Block a user