From 159eb75d7f5f5524fb37f75b5c92e67a032c5d6a Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Juan=20Jos=C3=A9=20Nicola?= Date: Thu, 15 Aug 2024 11:50:11 +0200 Subject: [PATCH] Fix: Never type fallback change (#1699) Never type (!) to any type (`never-to-any`) coercions fall back to never type (!) rather than to unit type (()). --- rust/feed-verifier/src/main.rs | 2 +- rust/redis-storage/src/connector.rs | 9 +++++---- 2 files changed, 6 insertions(+), 5 deletions(-) diff --git a/rust/feed-verifier/src/main.rs b/rust/feed-verifier/src/main.rs index 4f3aff935..06cd79b9a 100644 --- a/rust/feed-verifier/src/main.rs +++ b/rust/feed-verifier/src/main.rs @@ -58,7 +58,7 @@ fn get(con: &mut redis::Connection) -> RedisResult>> 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); diff --git a/rust/redis-storage/src/connector.rs b/rust/redis-storage/src/connector.rs index baa76d164..7d7fcfcba 100644 --- a/rust/redis-storage/src/connector.rs +++ b/rust/redis-storage/src/connector.rs @@ -621,7 +621,7 @@ 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(()) } @@ -629,7 +629,7 @@ impl RedisCtx { 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(()) } @@ -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(&mut self, key: &str, val: T) -> RedisStorageResult<()> { - self.kb + () = self + .kb .as_mut() .expect("Valid redis connection") .set(key, val)?;