I am a newbie with Rust. I am using the crate redis = "0.3.1"
but the program simply exits without raising a panic. The only thing I am doing different is that the database is different.
extern crate redis;
use redis::*;
use std::string::String;
use std::collections::HashSet;
fn main() {
read_meta_keys_redis("myset".to_string());
}
fn read_meta_keys_redis(key: String) -> redis::RedisResult<()> {
println!("22{}", key);
let client = try!(redis::Client::open("redis://127.0.0.1:6379/2"));
let con = try!(client.get_connection());
let mems: HashSet<i32> = try!(con.smembers(key));
for x in mems.iter() {
println!("op-->{}", x);
}
Ok(())
}