From 685c7a3f344c57be07b8a098aa8bb25e5e6ea500 Mon Sep 17 00:00:00 2001 From: Orne Brocaar Date: Thu, 19 Sep 2024 10:33:15 +0100 Subject: [PATCH] Fix serde not in scope error. As serde is an optional dependency, the #[serde(default)] must be behind a cfg_attr to make sure it is only applied in case the serde feature is enabled. --- redis/src/cluster/config.rs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/redis/src/cluster/config.rs b/redis/src/cluster/config.rs index cb7e042..076925f 100644 --- a/redis/src/cluster/config.rs +++ b/redis/src/cluster/config.rs @@ -59,7 +59,7 @@ pub struct Config { /// setup where read scalability is needed. /// /// Default is `false`. - #[serde(default)] + #[cfg_attr(feature = "serde", serde(default))] pub read_from_replicas: bool, }