File tree Expand file tree Collapse file tree 3 files changed +9
-7
lines changed
Expand file tree Collapse file tree 3 files changed +9
-7
lines changed Original file line number Diff line number Diff line change @@ -9,12 +9,6 @@ struct MyType {
99 data : String ,
1010}
1111
12- impl Default for MyType {
13- fn default ( ) -> Self {
14- MyType { data : Default :: default ( ) }
15- }
16- }
17-
1812static MY_REDIS_TYPE : RedisType = RedisType :: new ( "mytype123" ) ;
1913
2014fn alloc_set ( ctx : & Context , args : Vec < String > ) -> RedisResult {
Original file line number Diff line number Diff line change @@ -173,7 +173,7 @@ impl RedisKeyWritable {
173173 Ok ( "OK" . into ( ) )
174174 }
175175
176- pub fn get_value < T : Default > ( & self , redis_type : & RedisType ) -> Result < & mut T , RedisError > {
176+ pub fn get_value < T : Debug > ( & self , redis_type : & RedisType ) -> Result < & mut T , RedisError > {
177177 self . verify_type ( redis_type) ?;
178178
179179 let value = unsafe {
@@ -186,6 +186,8 @@ impl RedisKeyWritable {
186186
187187 let value = unsafe { & mut * value } ;
188188
189+ redis_log ( self . ctx , format ! ( "got value: '{:?}'" , value) . as_str ( ) ) ;
190+
189191 Ok ( value)
190192 }
191193
Original file line number Diff line number Diff line change @@ -27,6 +27,12 @@ impl From<i64> for RedisValue {
2727 }
2828}
2929
30+ impl From < String > for RedisValue {
31+ fn from ( s : String ) -> Self {
32+ RedisValue :: String ( s)
33+ }
34+ }
35+
3036impl From < & str > for RedisValue {
3137 fn from ( s : & str ) -> Self {
3238 RedisValue :: String ( s. to_string ( ) )
You can’t perform that action at this time.
0 commit comments