From 5a9f666a55ebb769e45e2b8a8477909a57855170 Mon Sep 17 00:00:00 2001 From: Nicolas Stinus Date: Mon, 5 Dec 2022 16:10:23 -0500 Subject: Gate async-traits behind a feature --- src/source.rs | 3 +++ 1 file changed, 3 insertions(+) (limited to 'src/source.rs') diff --git a/src/source.rs b/src/source.rs index 94f1c35..16e1938 100644 --- a/src/source.rs +++ b/src/source.rs @@ -1,6 +1,7 @@ use std::fmt::Debug; use std::str::FromStr; +#[cfg(feature = "async")] use async_trait::async_trait; use crate::error::Result; @@ -50,6 +51,7 @@ fn set_value(cache: &mut Value, key: &str, value: &Value) { /// It is advised to use `async_trait` crate while implementing this trait. /// /// See examples for sample implementation. +#[cfg(feature = "async")] #[async_trait] pub trait AsyncSource: Debug + Sync { // Sync is supertrait due to https://docs.rs/async-trait/0.1.50/async_trait/index.html#dyn-traits @@ -69,6 +71,7 @@ pub trait AsyncSource: Debug + Sync { } } +#[cfg(feature = "async")] impl Clone for Box { fn clone(&self) -> Self { self.to_owned() -- cgit v1.2.3