["{\"from\":1,\"date\":1651619967}",
"{\"from\":1,\"date\":1651619961}"]
I have this type of vector. I want to print out the string elements in this vector in the form of Json.
[{
"from":1,
"date":1651619967
}
, {
"from":1,
"date":1651619967
}]
I want to change it to a beautiful Json form like the one above. How can I do this? The only answer is to use the for statement? I want to know how to do this efficiently.
let values:Vec<String> = redis_conn
.zrevrange(room_key, 0, -1)
.expect("failed to execute ZREVRANGE for 'room_key'");
For your information, the vector above is the result obtained through zrevrange from redis.