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:
Maxime “pep” Buquet 2023-10-24 18:24:04 +02:00 committed by pep
commit a16f670ee6
5 changed files with 12 additions and 9 deletions

View file

@ -2,6 +2,9 @@
#![deny(unsafe_code, missing_docs, bare_trait_objects)]
#[cfg(all(feature = "tls-native", feature = "tls-rust"))]
compile_error!("Both tls-native and tls-rust features can't be enabled at the same time.");
mod starttls;
mod stream_start;
mod xmpp_codec;