Skip to content

Commit

Permalink
Fix serde not in scope error.
Browse files Browse the repository at this point in the history
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.
  • Loading branch information
brocaar authored and bikeshedder committed Sep 19, 2024
1 parent fb63bee commit 685c7a3
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion redis/src/cluster/config.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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,
}

Expand Down

0 comments on commit 685c7a3

Please sign in to comment.