@@ -3,7 +3,7 @@ extern crate redis_module;
33
44use redis_module:: native_types:: RedisType ;
55use redis_module:: { Context , NextArg , RedisError , RedisResult } ;
6- use std:: os:: raw:: { c_void} ;
6+ use std:: os:: raw:: c_void;
77
88#[ derive( Debug ) ]
99struct MyType {
@@ -17,7 +17,7 @@ static MY_REDIS_TYPE: RedisType = RedisType::new(
1717 version : raw:: REDISMODULE_TYPE_METHOD_VERSION as u64 ,
1818 rdb_load : None ,
1919 rdb_save : None ,
20- aof_rewrite : None ,
20+ aof_rewrite : None ,
2121 free : Some ( free) ,
2222
2323 // Currently unused by Redis
@@ -35,7 +35,6 @@ unsafe extern "C" fn free(value: *mut c_void) {
3535 Box :: from_raw ( value as * mut MyType ) ;
3636}
3737
38-
3938fn alloc_set ( ctx : & Context , args : Vec < String > ) -> RedisResult {
4039 let mut args = args. into_iter ( ) . skip ( 1 ) ;
4140 let key = args. next_string ( ) ?;
@@ -65,12 +64,10 @@ fn alloc_get(ctx: &Context, args: Vec<String>) -> RedisResult {
6564 let mut args = args. into_iter ( ) . skip ( 1 ) ;
6665 let key = args. next_string ( ) ?;
6766
68- let key = ctx. open_key ( & key) ;
67+ let key = ctx. open_key ( & key) ;
6968
7069 let value = match key. get_value :: < MyType > ( & MY_REDIS_TYPE ) ? {
71- Some ( value) => {
72- value. data . as_str ( ) . into ( )
73- }
70+ Some ( value) => value. data . as_str ( ) . into ( ) ,
7471 None => ( ) . into ( ) ,
7572 } ;
7673
0 commit comments