aboutsummaryrefslogtreecommitdiff
path: root/src/resp_parser.rs
diff options
context:
space:
mode:
authoromagdy <omar.professional8777@gmail.com>2025-07-20 16:29:34 +0300
committeromagdy <omar.professional8777@gmail.com>2025-07-20 16:29:34 +0300
commit846479e6bcf8238879546534b09e141b9bb668f8 (patch)
treeac2e65b5842bea095107c0a750843d0cf7bc74b4 /src/resp_parser.rs
parent38b649ea16d8ed053fd9222bfb9867e3432ee2a6 (diff)
downloadredis-rust-846479e6bcf8238879546534b09e141b9bb668f8.tar.xz
redis-rust-846479e6bcf8238879546534b09e141b9bb668f8.zip
feat: Added parsing of simple command line arguments and CONFIG GET command implementation
Diffstat (limited to 'src/resp_parser.rs')
-rw-r--r--src/resp_parser.rs6
1 files changed, 3 insertions, 3 deletions
diff --git a/src/resp_parser.rs b/src/resp_parser.rs
index 0563188..a00bc1b 100644
--- a/src/resp_parser.rs
+++ b/src/resp_parser.rs
@@ -587,11 +587,11 @@ impl RespType {
let len = arr.len();
let elements = arr
.iter()
- .map(|e| e.to_resp_bytes())
- .collect::<Vec<Vec<u8>>>();
+ .flat_map(|e| String::from_utf8(e.to_resp_bytes()))
+ .collect::<String>();
// TODO: Implement proper Display for elements because this will definitely not
// work
- format!("*{:?}\r\n{:?}", len, elements).into_bytes()
+ format!("*{}\r\n{}", len, elements).into_bytes()
}
// this is just a hack because the platform uses RESP2 in RESP3 it should be "_\r\n"
RespType::Null() => b"$-1\r\n".into(),