@@ -25,10 +25,10 @@ pub struct ClientList {
25
25
#[ derive( Debug , Default ) ]
26
26
pub enum ClientType {
27
27
#[ default]
28
- NORMAL ,
29
- REPLICA ,
30
- MASTER ,
31
- PUBSUB ,
28
+ Normal ,
29
+ Replica ,
30
+ Master ,
31
+ Pubsub ,
32
32
}
33
33
34
34
impl ClientList {
@@ -40,7 +40,7 @@ impl ClientList {
40
40
pub ( crate ) fn parse_frames (
41
41
parse : & mut Parse ,
42
42
) -> anyhow:: Result < ClientList > {
43
- let mut ty = ClientType :: NORMAL ;
43
+ let mut ty = ClientType :: Normal ;
44
44
let mut ids = Vec :: new ( ) ;
45
45
46
46
loop {
@@ -50,17 +50,17 @@ impl ClientList {
50
50
Ok ( "type" ) => {
51
51
let ty_opt = parse. next_string ( ) . map ( |x| x. to_lowercase ( ) ) ;
52
52
ty = match ty_opt. as_ref ( ) . map ( |x| & x[ ..] ) {
53
- Ok ( "normal" ) => ClientType :: NORMAL ,
54
- Ok ( "replica" ) => ClientType :: REPLICA ,
55
- Ok ( "master" ) => ClientType :: MASTER ,
56
- Ok ( "pubsub" ) => ClientType :: PUBSUB ,
53
+ Ok ( "normal" ) => ClientType :: Normal ,
54
+ Ok ( "replica" ) => ClientType :: Replica ,
55
+ Ok ( "master" ) => ClientType :: Master ,
56
+ Ok ( "pubsub" ) => ClientType :: Pubsub ,
57
57
Ok ( _) => {
58
58
bail ! (
59
59
"Unknown client type, should be either normal \
60
60
/ replica / master / pubsub."
61
61
) ;
62
62
}
63
- Err ( ParseError :: EndOfStream ) => ClientType :: NORMAL ,
63
+ Err ( ParseError :: EndOfStream ) => ClientType :: Normal ,
64
64
Err ( err) => {
65
65
bail ! ( "{}" , err) ;
66
66
}
@@ -112,7 +112,7 @@ impl ClientList {
112
112
mod tests {
113
113
use std:: io:: Cursor ;
114
114
115
- use bytes:: { Bytes , BytesMut } ;
115
+ use bytes:: BytesMut ;
116
116
use redis_async:: resp:: { RespCodec , RespValue } ;
117
117
use redis_async:: resp_array;
118
118
use tokio_util:: codec:: Encoder ;
0 commit comments