rust-sdk: Move some encryption specific imports under a cfg.

master
Damir Jelić 2020-04-03 10:42:03 +02:00
parent 7c6d0d14dd
commit 294ca108bb
2 changed files with 9 additions and 5 deletions

View File

@ -23,7 +23,9 @@ use std::time::{Duration, Instant};
use futures::future::Future; use futures::future::Future;
use tokio::sync::RwLock; use tokio::sync::RwLock;
use tokio::time::delay_for as sleep; use tokio::time::delay_for as sleep;
use tracing::{debug, info, instrument, trace}; #[cfg(feature = "encryption")]
use tracing::debug;
use tracing::{info, instrument, trace};
use http::Method as HttpMethod; use http::Method as HttpMethod;
use http::Response as HttpResponse; use http::Response as HttpResponse;
@ -746,14 +748,14 @@ impl AsyncClient {
self.base_client.read().await.sync_token.clone() self.base_client.read().await.sync_token.clone()
} }
#[cfg(feature = "encryption")]
#[cfg_attr(docsrs, doc(cfg(feature = "encryption")))]
#[instrument]
/// Query the server for users device keys. /// Query the server for users device keys.
/// ///
/// # Panics /// # Panics
/// ///
/// Panics if no key query needs to be done. /// Panics if no key query needs to be done.
#[cfg(feature = "encryption")]
#[cfg_attr(docsrs, doc(cfg(feature = "encryption")))]
#[instrument]
async fn keys_query(&self) -> Result<get_keys::Response> { async fn keys_query(&self) -> Result<get_keys::Response> {
let mut users_for_query = self let mut users_for_query = self
.base_client .base_client

View File

@ -13,7 +13,9 @@
// See the License for the specific language governing permissions and // See the License for the specific language governing permissions and
// limitations under the License. // limitations under the License.
use std::collections::{HashMap, HashSet}; use std::collections::HashMap;
#[cfg(feature = "encryption")]
use std::collections::HashSet;
use std::fmt; use std::fmt;
use std::sync::Arc; use std::sync::Arc;