Skip to content

Commit 31553e7

Browse files
Sqlx-core: simplify TimeoutError
1 parent fb3f254 commit 31553e7

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

sqlx-core/src/rt/mod.rs

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@ pub mod rt_tokio;
1212

1313
#[derive(Debug, thiserror::Error)]
1414
#[error("operation timed out")]
15-
pub struct TimeoutError(());
15+
pub struct TimeoutError;
1616

1717
pub enum JoinHandle<T> {
1818
#[cfg(feature = "_rt-async-std")]
@@ -28,14 +28,14 @@ pub async fn timeout<F: Future>(duration: Duration, f: F) -> Result<F::Output, T
2828
if rt_tokio::available() {
2929
return tokio::time::timeout(duration, f)
3030
.await
31-
.map_err(|_| TimeoutError(()));
31+
.map_err(|_| TimeoutError);
3232
}
3333

3434
#[cfg(feature = "_rt-async-std")]
3535
{
3636
async_std::future::timeout(duration, f)
3737
.await
38-
.map_err(|_| TimeoutError(()))
38+
.map_err(|_| TimeoutError);
3939
}
4040

4141
#[cfg(not(feature = "_rt-async-std"))]

0 commit comments

Comments
 (0)