Skip to content

Cleanup #740

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 3 commits into from
Oct 16, 2020
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
18 changes: 12 additions & 6 deletions sqlx-core/src/any/migrate.rs
Original file line number Diff line number Diff line change
Expand Up @@ -76,7 +76,7 @@ impl Migrate for AnyConnection {
AnyConnectionKind::MySql(conn) => conn.ensure_migrations_table(),

#[cfg(feature = "mssql")]
AnyConnectionKind::Mssql(conn) => unimplemented!(),
AnyConnectionKind::Mssql(_conn) => unimplemented!(),
}
}

Expand All @@ -92,7 +92,7 @@ impl Migrate for AnyConnection {
AnyConnectionKind::MySql(conn) => conn.version(),

#[cfg(feature = "mssql")]
AnyConnectionKind::Mssql(conn) => unimplemented!(),
AnyConnectionKind::Mssql(_conn) => unimplemented!(),
}
}

Expand All @@ -108,7 +108,7 @@ impl Migrate for AnyConnection {
AnyConnectionKind::MySql(conn) => conn.lock(),

#[cfg(feature = "mssql")]
AnyConnectionKind::Mssql(conn) => unimplemented!(),
AnyConnectionKind::Mssql(_conn) => unimplemented!(),
}
}

Expand All @@ -124,7 +124,7 @@ impl Migrate for AnyConnection {
AnyConnectionKind::MySql(conn) => conn.unlock(),

#[cfg(feature = "mssql")]
AnyConnectionKind::Mssql(conn) => unimplemented!(),
AnyConnectionKind::Mssql(_conn) => unimplemented!(),
}
}

Expand All @@ -143,7 +143,10 @@ impl Migrate for AnyConnection {
AnyConnectionKind::MySql(conn) => conn.validate(migration),

#[cfg(feature = "mssql")]
AnyConnectionKind::Mssql(conn) => unimplemented!(),
AnyConnectionKind::Mssql(_conn) => {
let _ = migration;
unimplemented!()
}
}
}

Expand All @@ -162,7 +165,10 @@ impl Migrate for AnyConnection {
AnyConnectionKind::MySql(conn) => conn.apply(migration),

#[cfg(feature = "mssql")]
AnyConnectionKind::Mssql(conn) => unimplemented!(),
AnyConnectionKind::Mssql(_conn) => {
let _ = migration;
unimplemented!()
}
}
}
}
18 changes: 7 additions & 11 deletions sqlx-rt/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -16,15 +16,15 @@ compile_error!(
"only one of 'runtime-actix', 'runtime-async-std' or 'runtime-tokio' features can be enabled"
);

pub use native_tls;
pub use native_tls::{self, Error as TlsError};

//
// Actix *OR* Tokio
//

#[cfg(all(
not(feature = "runtime-async-std"),
any(feature = "runtime-tokio", feature = "runtime-actix"),
not(feature = "runtime-async-std"),
))]
pub use tokio::{
self, fs, io::AsyncRead, io::AsyncReadExt, io::AsyncWrite, io::AsyncWriteExt, net::TcpStream,
Expand All @@ -33,11 +33,14 @@ pub use tokio::{

#[cfg(all(
unix,
not(feature = "runtime-async-std"),
any(feature = "runtime-tokio", feature = "runtime-actix"),
not(feature = "runtime-async-std"),
))]
pub use tokio::net::UnixStream;

#[cfg(all(feature = "tokio-native-tls", not(feature = "async-native-tls")))]
pub use tokio_native_tls::{TlsConnector, TlsStream};

//
// tokio
//
Expand All @@ -53,12 +56,6 @@ macro_rules! blocking {
};
}

#[cfg(all(feature = "tokio-native-tls", not(feature = "async-native-tls")))]
pub use tokio_native_tls::{TlsConnector, TlsStream};

#[cfg(all(feature = "tokio-native-tls", not(feature = "async-native-tls")))]
pub use native_tls::Error as TlsError;

//
// actix
//
Expand Down Expand Up @@ -113,7 +110,7 @@ macro_rules! blocking {
pub use async_std::os::unix::net::UnixStream;

#[cfg(all(feature = "async-native-tls", not(feature = "tokio-native-tls")))]
pub use async_native_tls::{Error as TlsError, TlsConnector, TlsStream};
pub use async_native_tls::{TlsConnector, TlsStream};

#[cfg(all(
feature = "runtime-async-std",
Expand Down Expand Up @@ -155,7 +152,6 @@ mod tokio_runtime {
.expect("failed to initialize Tokio runtime")
});

#[cfg(any(feature = "runtime-tokio", feature = "runtime-actix"))]
pub fn block_on<F: std::future::Future>(future: F) -> F::Output {
RUNTIME.enter(|| RUNTIME.handle().block_on(future))
}
Expand Down