From ced3d047568dff12cbf6373ad80ef5a83ebb2255 Mon Sep 17 00:00:00 2001 From: Rony Rahman Date: Tue, 19 Nov 2024 12:31:23 +1100 Subject: [PATCH] Formatting fix --- shotover/benches/benches/chain.rs | 12 +++++++----- shotover/src/codec/redis.rs | 6 +++--- shotover/src/transforms/redis/sink_cluster.rs | 4 +++- 3 files changed, 13 insertions(+), 9 deletions(-) diff --git a/shotover/benches/benches/chain.rs b/shotover/benches/benches/chain.rs index 4fe41d80d..597aaea8b 100644 --- a/shotover/benches/benches/chain.rs +++ b/shotover/benches/benches/chain.rs @@ -106,11 +106,13 @@ fn criterion_benchmark(c: &mut Criterion) { "bench", ); let chain_state = ChainState::new_with_addr( - vec![Message::from_frame(Frame::Valkey(ValkeyFrame::Array(vec![ - ValkeyFrame::BulkString(Bytes::from_static(b"SET")), - ValkeyFrame::BulkString(Bytes::from_static(b"foo")), - ValkeyFrame::BulkString(Bytes::from_static(b"bar")), - ])))], + vec![Message::from_frame(Frame::Valkey(ValkeyFrame::Array( + vec![ + ValkeyFrame::BulkString(Bytes::from_static(b"SET")), + ValkeyFrame::BulkString(Bytes::from_static(b"foo")), + ValkeyFrame::BulkString(Bytes::from_static(b"bar")), + ], + )))], "127.0.0.1:6379".parse().unwrap(), ); diff --git a/shotover/src/codec/redis.rs b/shotover/src/codec/redis.rs index ad5b3f9d8..3b81d2e3a 100644 --- a/shotover/src/codec/redis.rs +++ b/shotover/src/codec/redis.rs @@ -97,9 +97,9 @@ impl Decoder for ValkeyDecoder { fn decode(&mut self, src: &mut BytesMut) -> Result, Self::Error> { let received_at = Instant::now(); - match decode_bytes_mut(src) - .map_err(|e| CodecReadError::Parser(anyhow!(e).context("Error decoding valkey frame")))? - { + match decode_bytes_mut(src).map_err(|e| { + CodecReadError::Parser(anyhow!(e).context("Error decoding valkey frame")) + })? { Some((frame, _size, bytes)) => { tracing::debug!( "{}: incoming valkey message:\n{}", diff --git a/shotover/src/transforms/redis/sink_cluster.rs b/shotover/src/transforms/redis/sink_cluster.rs index 2069d6152..dc8fb4ff2 100644 --- a/shotover/src/transforms/redis/sink_cluster.rs +++ b/shotover/src/transforms/redis/sink_cluster.rs @@ -305,7 +305,9 @@ impl RedisSinkCluster { Ok(Response { response: Err(e), .. }) => Some((None, ValkeyFrame::Error(e.to_string().into()))), - Err(e) => Some((None, ValkeyFrame::Error(e.to_string().into()))), + Err(e) => { + Some((None, ValkeyFrame::Error(e.to_string().into()))) + } } } })