Skip to content

Commit 5f19573

Browse files
committed
fix code formatting
1 parent 82eecf5 commit 5f19573

File tree

5 files changed

+26
-51
lines changed

5 files changed

+26
-51
lines changed

src/client/client.rs

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -267,7 +267,10 @@ impl Client {
267267
#[inline]
268268
fn send_message(&self, message: Message) -> Result<()> {
269269
if let Some(msg_sender) = &self.msg_sender as &Option<MsgSender> {
270-
trace!("[{}], Will enqueue message: {message:?}", self.connection_tag);
270+
trace!(
271+
"[{}], Will enqueue message: {message:?}",
272+
self.connection_tag
273+
);
271274
Ok(msg_sender.unbounded_send(message).map_err(|e| {
272275
info!("{}", e);
273276
Error::Client("Disconnected from server".to_string())

src/lib.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -152,13 +152,13 @@ async fn main() -> Result<()> {
152152
See the module [`cache`] to discover how you can implement client-side caching.
153153
*/
154154

155+
#[cfg(feature = "client-cache")]
156+
pub mod cache;
155157
pub mod client;
156158
pub mod commands;
157159
mod error;
158160
mod network;
159161
pub mod resp;
160-
#[cfg(feature = "client-cache")]
161-
pub mod cache;
162162

163163
#[cfg(feature = "pool")]
164164
pub use bb8;

src/network/network_handler.rs

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -106,7 +106,9 @@ pub(crate) struct NetworkHandler {
106106
}
107107

108108
impl NetworkHandler {
109-
pub async fn connect(config: Config) -> Result<(MsgSender, JoinHandle<()>, ReconnectSender, String)> {
109+
pub async fn connect(
110+
config: Config,
111+
) -> Result<(MsgSender, JoinHandle<()>, ReconnectSender, String)> {
110112
// options
111113
let auto_resubscribe = config.auto_resubscribe;
112114
let auto_remonitor = config.auto_remonitor;

src/resp/response.rs

Lines changed: 15 additions & 45 deletions
Original file line numberDiff line numberDiff line change
@@ -53,9 +53,7 @@ where
5353
{
5454
fn from_collection<I: IntoIterator<Item = T>>(iter: I) -> Self {
5555
let mut it = iter.into_iter();
56-
std::array::from_fn(|_| {
57-
it.next().expect("Not enough elements in iterator")
58-
})
56+
std::array::from_fn(|_| it.next().expect("Not enough elements in iterator"))
5957
}
6058
}
6159
impl<T> CollectionResponse<T> for [T; 2]
@@ -64,9 +62,7 @@ where
6462
{
6563
fn from_collection<I: IntoIterator<Item = T>>(iter: I) -> Self {
6664
let mut it = iter.into_iter();
67-
std::array::from_fn(|_| {
68-
it.next().expect("Not enough elements in iterator")
69-
})
65+
std::array::from_fn(|_| it.next().expect("Not enough elements in iterator"))
7066
}
7167
}
7268
impl<T> CollectionResponse<T> for [T; 3]
@@ -75,9 +71,7 @@ where
7571
{
7672
fn from_collection<I: IntoIterator<Item = T>>(iter: I) -> Self {
7773
let mut it = iter.into_iter();
78-
std::array::from_fn(|_| {
79-
it.next().expect("Not enough elements in iterator")
80-
})
74+
std::array::from_fn(|_| it.next().expect("Not enough elements in iterator"))
8175
}
8276
}
8377
impl<T> CollectionResponse<T> for [T; 4]
@@ -86,9 +80,7 @@ where
8680
{
8781
fn from_collection<I: IntoIterator<Item = T>>(iter: I) -> Self {
8882
let mut it = iter.into_iter();
89-
std::array::from_fn(|_| {
90-
it.next().expect("Not enough elements in iterator")
91-
})
83+
std::array::from_fn(|_| it.next().expect("Not enough elements in iterator"))
9284
}
9385
}
9486
impl<T> CollectionResponse<T> for [T; 5]
@@ -97,9 +89,7 @@ where
9789
{
9890
fn from_collection<I: IntoIterator<Item = T>>(iter: I) -> Self {
9991
let mut it = iter.into_iter();
100-
std::array::from_fn(|_| {
101-
it.next().expect("Not enough elements in iterator")
102-
})
92+
std::array::from_fn(|_| it.next().expect("Not enough elements in iterator"))
10393
}
10494
}
10595
impl<T> CollectionResponse<T> for [T; 6]
@@ -108,9 +98,7 @@ where
10898
{
10999
fn from_collection<I: IntoIterator<Item = T>>(iter: I) -> Self {
110100
let mut it = iter.into_iter();
111-
std::array::from_fn(|_| {
112-
it.next().expect("Not enough elements in iterator")
113-
})
101+
std::array::from_fn(|_| it.next().expect("Not enough elements in iterator"))
114102
}
115103
}
116104
impl<T> CollectionResponse<T> for [T; 7]
@@ -119,9 +107,7 @@ where
119107
{
120108
fn from_collection<I: IntoIterator<Item = T>>(iter: I) -> Self {
121109
let mut it = iter.into_iter();
122-
std::array::from_fn(|_| {
123-
it.next().expect("Not enough elements in iterator")
124-
})
110+
std::array::from_fn(|_| it.next().expect("Not enough elements in iterator"))
125111
}
126112
}
127113
impl<T> CollectionResponse<T> for [T; 8]
@@ -130,9 +116,7 @@ where
130116
{
131117
fn from_collection<I: IntoIterator<Item = T>>(iter: I) -> Self {
132118
let mut it = iter.into_iter();
133-
std::array::from_fn(|_| {
134-
it.next().expect("Not enough elements in iterator")
135-
})
119+
std::array::from_fn(|_| it.next().expect("Not enough elements in iterator"))
136120
}
137121
}
138122
impl<T> CollectionResponse<T> for [T; 9]
@@ -141,9 +125,7 @@ where
141125
{
142126
fn from_collection<I: IntoIterator<Item = T>>(iter: I) -> Self {
143127
let mut it = iter.into_iter();
144-
std::array::from_fn(|_| {
145-
it.next().expect("Not enough elements in iterator")
146-
})
128+
std::array::from_fn(|_| it.next().expect("Not enough elements in iterator"))
147129
}
148130
}
149131
impl<T> CollectionResponse<T> for [T; 10]
@@ -152,9 +134,7 @@ where
152134
{
153135
fn from_collection<I: IntoIterator<Item = T>>(iter: I) -> Self {
154136
let mut it = iter.into_iter();
155-
std::array::from_fn(|_| {
156-
it.next().expect("Not enough elements in iterator")
157-
})
137+
std::array::from_fn(|_| it.next().expect("Not enough elements in iterator"))
158138
}
159139
}
160140
impl<T> CollectionResponse<T> for [T; 11]
@@ -163,9 +143,7 @@ where
163143
{
164144
fn from_collection<I: IntoIterator<Item = T>>(iter: I) -> Self {
165145
let mut it = iter.into_iter();
166-
std::array::from_fn(|_| {
167-
it.next().expect("Not enough elements in iterator")
168-
})
146+
std::array::from_fn(|_| it.next().expect("Not enough elements in iterator"))
169147
}
170148
}
171149
impl<T> CollectionResponse<T> for [T; 12]
@@ -174,9 +152,7 @@ where
174152
{
175153
fn from_collection<I: IntoIterator<Item = T>>(iter: I) -> Self {
176154
let mut it = iter.into_iter();
177-
std::array::from_fn(|_| {
178-
it.next().expect("Not enough elements in iterator")
179-
})
155+
std::array::from_fn(|_| it.next().expect("Not enough elements in iterator"))
180156
}
181157
}
182158
impl<T> CollectionResponse<T> for [T; 13]
@@ -185,9 +161,7 @@ where
185161
{
186162
fn from_collection<I: IntoIterator<Item = T>>(iter: I) -> Self {
187163
let mut it = iter.into_iter();
188-
std::array::from_fn(|_| {
189-
it.next().expect("Not enough elements in iterator")
190-
})
164+
std::array::from_fn(|_| it.next().expect("Not enough elements in iterator"))
191165
}
192166
}
193167
impl<T> CollectionResponse<T> for [T; 14]
@@ -196,9 +170,7 @@ where
196170
{
197171
fn from_collection<I: IntoIterator<Item = T>>(iter: I) -> Self {
198172
let mut it = iter.into_iter();
199-
std::array::from_fn(|_| {
200-
it.next().expect("Not enough elements in iterator")
201-
})
173+
std::array::from_fn(|_| it.next().expect("Not enough elements in iterator"))
202174
}
203175
}
204176
impl<T> CollectionResponse<T> for [T; 15]
@@ -207,9 +179,7 @@ where
207179
{
208180
fn from_collection<I: IntoIterator<Item = T>>(iter: I) -> Self {
209181
let mut it = iter.into_iter();
210-
std::array::from_fn(|_| {
211-
it.next().expect("Not enough elements in iterator")
212-
})
182+
std::array::from_fn(|_| it.next().expect("Not enough elements in iterator"))
213183
}
214184
}
215185

src/tests/mod.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,13 @@
11
mod bitmap_commands;
22
mod bloom_commands;
33
mod buffer_decoder;
4+
#[cfg(feature = "client-cache")]
5+
mod cache;
46
mod client;
57
mod cluster;
68
mod cluster_commands;
79
mod command_args;
810
mod command_info_manager;
9-
#[cfg(feature = "client-cache")]
10-
mod cache;
1111
mod config;
1212
mod connection_commands;
1313
mod count_min_sktech_commands;

0 commit comments

Comments
 (0)