Skip to content

Commit

Permalink
fix build with no default runtime
Browse files Browse the repository at this point in the history
  • Loading branch information
Keruspe committed Jul 3, 2024
1 parent e8d2242 commit 84c0010
Showing 1 changed file with 12 additions and 8 deletions.
20 changes: 12 additions & 8 deletions src/connection_properties.rs
Original file line number Diff line number Diff line change
Expand Up @@ -52,22 +52,26 @@ impl ConnectionProperties {
return Ok(executor);
}

if cfg!(feature = "default-runtime") {
Ok(Arc::new(async_global_executor_trait::AsyncGlobalExecutor))
} else {
Err(Error::NoConfiguredExecutor)
#[cfg(feature = "default-runtime")]
{
return Ok(Arc::new(async_global_executor_trait::AsyncGlobalExecutor));
}

#[allow(unreachable_code)]
Err(Error::NoConfiguredExecutor)
}

pub(crate) fn take_reactor(&mut self) -> Result<Arc<dyn FullReactor + Send + Sync>> {
if let Some(reactor) = self.reactor.take() {
return Ok(reactor);
}

if cfg!(feature = "default-runtime") {
Ok(Arc::new(async_reactor_trait::AsyncIo))
} else {
Err(Error::NoConfiguredReactor)
#[cfg(feature = "default-runtime")]
{
return Ok(Arc::new(async_reactor_trait::AsyncIo));
}

#[allow(unreachable_code)]
Err(Error::NoConfiguredReactor)
}
}

0 comments on commit 84c0010

Please sign in to comment.