mirror of
https://github.com/teloxide/teloxide.git
synced 2024-12-22 22:46:39 +01:00
Merge branch 'fix-remove-dialogue-sqlite' of https://github.com/teloxide/teloxide into fix-remove-dialogue-sqlite
This commit is contained in:
commit
d14e0a49e9
1 changed files with 10 additions and 13 deletions
|
@ -65,19 +65,16 @@ where
|
|||
.query_async::<_, redis::Value>(self.conn.lock().await.deref_mut())
|
||||
.await?;
|
||||
|
||||
let deleted_rows_count = match deleted_rows_count {
|
||||
redis::Value::Bulk(values) => match values[0] {
|
||||
redis::Value::Int(x) => x,
|
||||
_ => unreachable!("Must return redis::Value::Int"),
|
||||
},
|
||||
_ => unreachable!("Must return redis::Value::Bulk"),
|
||||
};
|
||||
|
||||
if deleted_rows_count == 0 {
|
||||
return Err(RedisStorageError::RowNotFound);
|
||||
}
|
||||
|
||||
Ok(())
|
||||
if let redis::Value::Bulk(values) = deleted_rows_count {
|
||||
if let redis::Value::Int(deleted_rows_count) = values[0] {
|
||||
match deleted_rows_count {
|
||||
0 => return Err(RedisStorageError::RowNotFound),
|
||||
_ => return Ok(())
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
unreachable!("Must return redis::Value::Bulk(redis::Value::Int(_))");
|
||||
})
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in a new issue