tokio-xmpp: Error out when both tls-native and tls-rust features are enabled
If the user enables the tls-rust feature and forgets to disable default-features (which includes tls-native), tell them and bail out. The code was made to work anyway when both are enabled, and here it defaults to tls-native. It does seem better to have one explicitely choose one though hence the compile_error! message. Signed-off-by: Maxime “pep” Buquet <pep@bouah.net>
This commit is contained in:
parent
fc16b7919b
commit
a16f670ee6
5 changed files with 12 additions and 9 deletions
|
|
@ -7,7 +7,7 @@ use tokio::net::TcpStream;
|
|||
use tokio::task::JoinHandle;
|
||||
#[cfg(feature = "tls-native")]
|
||||
use tokio_native_tls::TlsStream;
|
||||
#[cfg(feature = "tls-rust")]
|
||||
#[cfg(all(feature = "tls-rust", not(feature = "tls-native")))]
|
||||
use tokio_rustls::client::TlsStream;
|
||||
use xmpp_parsers::{ns, Element, Jid};
|
||||
|
||||
|
|
|
|||
|
|
@ -7,7 +7,7 @@ use std::task::{Context, Poll};
|
|||
use tokio::net::TcpStream;
|
||||
#[cfg(feature = "tls-native")]
|
||||
use tokio_native_tls::TlsStream;
|
||||
#[cfg(feature = "tls-rust")]
|
||||
#[cfg(all(feature = "tls-rust", not(feature = "tls-native")))]
|
||||
use tokio_rustls::client::TlsStream;
|
||||
use tokio_stream::StreamExt;
|
||||
use xmpp_parsers::{ns, Element, Jid};
|
||||
|
|
|
|||
Loading…
Reference in a new issue