let mut con = client.get_connection()?;
redis::cmd("SET").arg("my_key").arg(42).execute(&mut con);
Due to this, `transaction` has changed. The callback now also receives a mutable reference to the used connection.
Old code:
rust
let client = redis::Client::open("redis://127.0.0.1/").unwrap();
let con = client.get_connection().unwrap();
let key = "the_key";
let (new_val,) : (isize,) = redis::transaction(&con, &[key], |pipe| {
let old_val : isize = con.get(key)?;
pipe
.set(key, old_val + 1).ignore()
.get(key).query(&con)
})?;
New code:
rust
let client = redis::Client::open("redis://127.0.0.1/").unwrap();
let mut con = client.get_connection().unwrap();
let key = "the_key";
let (new_val,) : (isize,) = redis::transaction(&mut con, &[key], |con, pipe| {
let old_val : isize = con.get(key)?;
pipe
.set(key, old_val + 1).ignore()
.get(key).query(&con)
})?;
Remove `rustc-serialize` feature ([200](https://github.com/mitsuhiko/redis-rs/pull/200))
We removed serialization to/from JSON. The underlying library is deprecated for a long time.
Old code in `Cargo.toml`:
[dependencies.redis]