let manager = RedisConnectionManager::new("redis://127.0.0.1:6379").unwrap();
let pool = r2d2::Pool::builder().build(manager).unwrap();
let pool2 = pool.clone();
let mut conn = pool.get().unwrap();
let n: i64 = conn.incr("counter", 1).unwrap();
let con = *conn;
let x = conn.set("ccc", 10);
get error
error[E0283]: type annotations required: cannot resolve `_: redis::FromRedisValue`
--> src/db/redis.rs:17:18
|
17 | let x = conn.set("ccc", 10);
|
or I use
redis::cmd("SET").arg("my_key").arg(42).execute(&mut *conn);
this code is ok
but when I use
redis::cmd("GET").arg("my_key").query(&mut *conn);
get the same error
get error
or I use
redis::cmd("SET").arg("my_key").arg(42).execute(&mut *conn);
this code is okbut when I use
redis::cmd("GET").arg("my_key").query(&mut *conn);
get the same errorHow can I fix it ?