| 
														
															@@ -1,10 +1,10 @@ 
														 | 
													
												
											
												
													
														| 
														 | 
														
															-use crate::{connection::Connection, error::Error, value::checksum, value::Value}; 
														 | 
														
														 | 
														
															 
														 | 
													
												
											
												
													
														| 
														 | 
														
															 
														 | 
														
														 | 
														
															+use crate::{connection::Connection, error::Error, value::Value}; 
														 | 
													
												
											
												
													
														| 
														 | 
														
															 use bytes::Bytes; 
														 | 
														
														 | 
														
															 use bytes::Bytes; 
														 | 
													
												
											
												
													
														| 
														 | 
														
															 use std::collections::HashSet; 
														 | 
														
														 | 
														
															 use std::collections::HashSet; 
														 | 
													
												
											
												
													
														| 
														 | 
														
															  
														 | 
														
														 | 
														
															  
														 | 
													
												
											
												
													
														| 
														 | 
														
															 async fn compare_sets<F1>(conn: &Connection, keys: &[Bytes], op: F1) -> Result<Value, Error> 
														 | 
														
														 | 
														
															 async fn compare_sets<F1>(conn: &Connection, keys: &[Bytes], op: F1) -> Result<Value, Error> 
														 | 
													
												
											
												
													
														| 
														 | 
														
															 where 
														 | 
														
														 | 
														
															 where 
														 | 
													
												
											
												
													
														| 
														 | 
														
															-    F1: Fn(&mut HashSet<checksum::Value>, &HashSet<checksum::Value>) -> bool, 
														 | 
														
														 | 
														
															 
														 | 
													
												
											
												
													
														| 
														 | 
														
															 
														 | 
														
														 | 
														
															+    F1: Fn(&mut HashSet<Bytes>, &HashSet<Bytes>) -> bool, 
														 | 
													
												
											
												
													
														| 
														 | 
														
															 { 
														 | 
														
														 | 
														
															 { 
														 | 
													
												
											
												
													
														| 
														 | 
														
															     conn.db().get_map_or( 
														 | 
														
														 | 
														
															     conn.db().get_map_or( 
														 | 
													
												
											
												
													
														| 
														 | 
														
															         &keys[0], 
														 | 
														
														 | 
														
															         &keys[0], 
														 | 
													
												
											
										
											
												
													
														 | 
														
															@@ -34,7 +34,7 @@ where 
														 | 
													
												
											
												
													
														| 
														 | 
														
															  
														 | 
														
														 | 
														
															  
														 | 
													
												
											
												
													
														| 
														 | 
														
															                 Ok(all_entries 
														 | 
														
														 | 
														
															                 Ok(all_entries 
														 | 
													
												
											
												
													
														| 
														 | 
														
															                     .iter() 
														 | 
														
														 | 
														
															                     .iter() 
														 | 
													
												
											
												
													
														| 
														 | 
														
															-                    .map(|entry| entry.clone_value()) 
														 | 
														
														 | 
														
															 
														 | 
													
												
											
												
													
														| 
														 | 
														
															 
														 | 
														
														 | 
														
															+                    .map(|entry| Value::Blob(entry.clone())) 
														 | 
													
												
											
												
													
														| 
														 | 
														
															                     .collect::<Vec<Value>>() 
														 | 
														
														 | 
														
															                     .collect::<Vec<Value>>() 
														 | 
													
												
											
												
													
														| 
														 | 
														
															                     .into()) 
														 | 
														
														 | 
														
															                     .into()) 
														 | 
													
												
											
												
													
														| 
														 | 
														
															             } 
														 | 
														
														 | 
														
															             } 
														 | 
													
												
											
										
											
												
													
														 | 
														
															@@ -54,7 +54,7 @@ pub async fn sadd(conn: &Connection, args: &[Bytes]) -> Result<Value, Error> { 
														 | 
													
												
											
												
													
														| 
														 | 
														
															                 let mut len = 0; 
														 | 
														
														 | 
														
															                 let mut len = 0; 
														 | 
													
												
											
												
													
														| 
														 | 
														
															  
														 | 
														
														 | 
														
															  
														 | 
													
												
											
												
													
														| 
														 | 
														
															                 for val in (&args[2..]).iter() { 
														 | 
														
														 | 
														
															                 for val in (&args[2..]).iter() { 
														 | 
													
												
											
												
													
														| 
														 | 
														
															-                    if x.insert(checksum::Value::new(val.clone())) { 
														 | 
														
														 | 
														
															 
														 | 
													
												
											
												
													
														| 
														 | 
														
															 
														 | 
														
														 | 
														
															+                    if x.insert(val.clone()) { 
														 | 
													
												
											
												
													
														| 
														 | 
														
															                         len += 1; 
														 | 
														
														 | 
														
															                         len += 1; 
														 | 
													
												
											
												
													
														| 
														 | 
														
															                     } 
														 | 
														
														 | 
														
															                     } 
														 | 
													
												
											
												
													
														| 
														 | 
														
															                 } 
														 | 
														
														 | 
														
															                 } 
														 | 
													
												
											
										
											
												
													
														 | 
														
															@@ -69,7 +69,7 @@ pub async fn sadd(conn: &Connection, args: &[Bytes]) -> Result<Value, Error> { 
														 | 
													
												
											
												
													
														| 
														 | 
														
															             let mut len = 0; 
														 | 
														
														 | 
														
															             let mut len = 0; 
														 | 
													
												
											
												
													
														| 
														 | 
														
															  
														 | 
														
														 | 
														
															  
														 | 
													
												
											
												
													
														| 
														 | 
														
															             for val in (&args[2..]).iter() { 
														 | 
														
														 | 
														
															             for val in (&args[2..]).iter() { 
														 | 
													
												
											
												
													
														| 
														 | 
														
															-                if x.insert(checksum::Value::new(val.clone())) { 
														 | 
														
														 | 
														
															 
														 | 
													
												
											
												
													
														| 
														 | 
														
															 
														 | 
														
														 | 
														
															+                if x.insert(val.clone()) { 
														 | 
													
												
											
												
													
														| 
														 | 
														
															                     len += 1; 
														 | 
														
														 | 
														
															                     len += 1; 
														 | 
													
												
											
												
													
														| 
														 | 
														
															                 } 
														 | 
														
														 | 
														
															                 } 
														 | 
													
												
											
												
													
														| 
														 | 
														
															             } 
														 | 
														
														 | 
														
															             } 
														 | 
													
												
											
										
											
												
													
														 | 
														
															@@ -112,7 +112,7 @@ pub async fn sdiffstore(conn: &Connection, args: &[Bytes]) -> Result<Value, Erro 
														 | 
													
												
											
												
													
														| 
														 | 
														
															  
														 | 
														
														 | 
														
															  
														 | 
													
												
											
												
													
														| 
														 | 
														
															         for val in values.iter() { 
														 | 
														
														 | 
														
															         for val in values.iter() { 
														 | 
													
												
											
												
													
														| 
														 | 
														
															             if let Value::Blob(blob) = val { 
														 | 
														
														 | 
														
															             if let Value::Blob(blob) = val { 
														 | 
													
												
											
												
													
														| 
														 | 
														
															-                if x.insert(checksum::Value::new(blob.clone())) { 
														 | 
														
														 | 
														
															 
														 | 
													
												
											
												
													
														| 
														 | 
														
															 
														 | 
														
														 | 
														
															+                if x.insert(blob.clone()) { 
														 | 
													
												
											
												
													
														| 
														 | 
														
															                     len += 1; 
														 | 
														
														 | 
														
															                     len += 1; 
														 | 
													
												
											
												
													
														| 
														 | 
														
															                 } 
														 | 
														
														 | 
														
															                 } 
														 | 
													
												
											
												
													
														| 
														 | 
														
															             } 
														 | 
														
														 | 
														
															             } 
														 | 
													
												
											
										
											
												
													
														 | 
														
															@@ -157,7 +157,7 @@ pub async fn sinterstore(conn: &Connection, args: &[Bytes]) -> Result<Value, Err 
														 | 
													
												
											
												
													
														| 
														 | 
														
															  
														 | 
														
														 | 
														
															  
														 | 
													
												
											
												
													
														| 
														 | 
														
															         for val in values.iter() { 
														 | 
														
														 | 
														
															         for val in values.iter() { 
														 | 
													
												
											
												
													
														| 
														 | 
														
															             if let Value::Blob(blob) = val { 
														 | 
														
														 | 
														
															             if let Value::Blob(blob) = val { 
														 | 
													
												
											
												
													
														| 
														 | 
														
															-                if x.insert(checksum::Value::new(blob.clone())) { 
														 | 
														
														 | 
														
															 
														 | 
													
												
											
												
													
														| 
														 | 
														
															 
														 | 
														
														 | 
														
															+                if x.insert(blob.clone()) { 
														 | 
													
												
											
												
													
														| 
														 | 
														
															                     len += 1; 
														 | 
														
														 | 
														
															                     len += 1; 
														 | 
													
												
											
												
													
														| 
														 | 
														
															                 } 
														 | 
														
														 | 
														
															                 } 
														 | 
													
												
											
												
													
														| 
														 | 
														
															             } 
														 | 
														
														 | 
														
															             } 
														 | 
													
												
											
										
											
												
													
														 | 
														
															@@ -176,7 +176,7 @@ pub async fn sismember(conn: &Connection, args: &[Bytes]) -> Result<Value, Error 
														 | 
													
												
											
												
													
														| 
														 | 
														
															         &args[1], 
														 | 
														
														 | 
														
															         &args[1], 
														 | 
													
												
											
												
													
														| 
														 | 
														
															         |v| match v { 
														 | 
														
														 | 
														
															         |v| match v { 
														 | 
													
												
											
												
													
														| 
														 | 
														
															             Value::Set(x) => { 
														 | 
														
														 | 
														
															             Value::Set(x) => { 
														 | 
													
												
											
												
													
														| 
														 | 
														
															-                if x.read().contains(&checksum::Value::new(args[2].clone())) { 
														 | 
														
														 | 
														
															 
														 | 
													
												
											
												
													
														| 
														 | 
														
															 
														 | 
														
														 | 
														
															+                if x.read().contains(&args[2]) { 
														 | 
													
												
											
												
													
														| 
														 | 
														
															                     Ok(1.into()) 
														 | 
														
														 | 
														
															                     Ok(1.into()) 
														 | 
													
												
											
												
													
														| 
														 | 
														
															                 } else { 
														 | 
														
														 | 
														
															                 } else { 
														 | 
													
												
											
												
													
														| 
														 | 
														
															                     Ok(0.into()) 
														 | 
														
														 | 
														
															                     Ok(0.into()) 
														 | 
													
												
											
										
											
												
													
														 | 
														
															@@ -195,7 +195,7 @@ pub async fn smembers(conn: &Connection, args: &[Bytes]) -> Result<Value, Error> 
														 | 
													
												
											
												
													
														| 
														 | 
														
															             Value::Set(x) => Ok(x 
														 | 
														
														 | 
														
															             Value::Set(x) => Ok(x 
														 | 
													
												
											
												
													
														| 
														 | 
														
															                 .read() 
														 | 
														
														 | 
														
															                 .read() 
														 | 
													
												
											
												
													
														| 
														 | 
														
															                 .iter() 
														 | 
														
														 | 
														
															                 .iter() 
														 | 
													
												
											
												
													
														| 
														 | 
														
															-                .map(|x| x.clone_value()) 
														 | 
														
														 | 
														
															 
														 | 
													
												
											
												
													
														| 
														 | 
														
															 
														 | 
														
														 | 
														
															+                .map(|x| Value::Blob(x.clone())) 
														 | 
													
												
											
												
													
														| 
														 | 
														
															                 .collect::<Vec<Value>>() 
														 | 
														
														 | 
														
															                 .collect::<Vec<Value>>() 
														 | 
													
												
											
												
													
														| 
														 | 
														
															                 .into()), 
														 | 
														
														 | 
														
															                 .into()), 
														 | 
													
												
											
												
													
														| 
														 | 
														
															             _ => Err(Error::WrongType), 
														 | 
														
														 | 
														
															             _ => Err(Error::WrongType), 
														 | 
													
												
											
										
											
												
													
														 | 
														
															@@ -213,7 +213,7 @@ pub async fn smismember(conn: &Connection, args: &[Bytes]) -> Result<Value, Erro 
														 | 
													
												
											
												
													
														| 
														 | 
														
															                 Ok((&args[2..]) 
														 | 
														
														 | 
														
															                 Ok((&args[2..]) 
														 | 
													
												
											
												
													
														| 
														 | 
														
															                     .iter() 
														 | 
														
														 | 
														
															                     .iter() 
														 | 
													
												
											
												
													
														| 
														 | 
														
															                     .map(|member| { 
														 | 
														
														 | 
														
															                     .map(|member| { 
														 | 
													
												
											
												
													
														| 
														 | 
														
															-                        if x.contains(&checksum::Value::new(member.clone())) { 
														 | 
														
														 | 
														
															 
														 | 
													
												
											
												
													
														| 
														 | 
														
															 
														 | 
														
														 | 
														
															+                        if x.contains(member) { 
														 | 
													
												
											
												
													
														| 
														 | 
														
															                             1 
														 | 
														
														 | 
														
															                             1 
														 | 
													
												
											
												
													
														| 
														 | 
														
															                         } else { 
														 | 
														
														 | 
														
															                         } else { 
														 | 
													
												
											
												
													
														| 
														 | 
														
															                             0 
														 | 
														
														 | 
														
															                             0 
														 |