Skip to content

Commit

Permalink
Formatting fix
Browse files Browse the repository at this point in the history
  • Loading branch information
ronycsdu committed Nov 19, 2024
1 parent de30459 commit ced3d04
Show file tree
Hide file tree
Showing 3 changed files with 13 additions and 9 deletions.
12 changes: 7 additions & 5 deletions shotover/benches/benches/chain.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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(),
);

Expand Down
6 changes: 3 additions & 3 deletions shotover/src/codec/redis.rs
Original file line number Diff line number Diff line change
Expand Up @@ -97,9 +97,9 @@ impl Decoder for ValkeyDecoder {

fn decode(&mut self, src: &mut BytesMut) -> Result<Option<Self::Item>, 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{}",
Expand Down
4 changes: 3 additions & 1 deletion shotover/src/transforms/redis/sink_cluster.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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())))
}
}
}
})
Expand Down

0 comments on commit ced3d04

Please sign in to comment.