Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix: Never type fallback change #1699

Merged
merged 2 commits into from
Aug 15, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion rust/feed-verifier/src/main.rs
Original file line number Diff line number Diff line change
Expand Up @@ -58,7 +58,7 @@ fn get(con: &mut redis::Connection) -> RedisResult<HashMap<String, Vec<String>>>
redis::Cmd::new()
.arg("SELECT")
.arg(i.to_string())
.query(con)?;
.query::<()>(con)?;
let result = get_all(con)?;
if result.len() > 1 {
return Ok(result);
Expand Down
9 changes: 5 additions & 4 deletions rust/redis-storage/src/connector.rs
Original file line number Diff line number Diff line change
Expand Up @@ -621,15 +621,15 @@ impl RedisCtx {
.cmd("SELECT")
.arg(self.db)
.ignore()
.query(&mut self.kb.as_mut().expect("Valid redis connection"))?;
.query::<()>(&mut self.kb.as_mut().expect("Valid redis connection"))?;
Ok(())
}

/// Delete all keys in the namespace and release the it
pub fn delete_namespace(&mut self) -> RedisStorageResult<()> {
Cmd::new()
.arg("FLUSHDB")
.query(&mut self.kb.as_mut().expect("Valid redis connection"))?;
.query::<()>(&mut self.kb.as_mut().expect("Valid redis connection"))?;
self.release_namespace()?;
Ok(())
}
Expand All @@ -638,13 +638,14 @@ impl RedisCtx {
pub fn flush_namespace(&mut self) -> RedisStorageResult<()> {
Cmd::new()
.arg("FLUSHDB")
.query(&mut self.kb.as_mut().expect("Valid redis connection"))?;
.query::<()>(&mut self.kb.as_mut().expect("Valid redis connection"))?;
Ok(())
}

//Wrapper function to avoid accessing kb member directly.
pub fn set_value<T: ToRedisArgs>(&mut self, key: &str, val: T) -> RedisStorageResult<()> {
self.kb
() = self
.kb
.as_mut()
.expect("Valid redis connection")
.set(key, val)?;
Expand Down
Loading