File tree Expand file tree Collapse file tree 1 file changed +6
-8
lines changed Expand file tree Collapse file tree 1 file changed +6
-8
lines changed Original file line number Diff line number Diff line change @@ -23,15 +23,13 @@ impl FromStr for Reply {
23
23
fn from_str ( s : & str ) -> Result < Reply , ParseError > {
24
24
if s == "OK" || s == "list_OK" {
25
25
Ok ( Reply :: Ok )
26
+ } else if let Ok ( ack) = s. parse :: < ServerError > ( ) {
27
+ Ok ( Reply :: Ack ( ack) )
26
28
} else {
27
- if let Ok ( ack) = s. parse :: < ServerError > ( ) {
28
- Ok ( Reply :: Ack ( ack) )
29
- } else {
30
- let mut splits = s. splitn ( 2 , ':' ) ;
31
- match ( splits. next ( ) , splits. next ( ) ) {
32
- ( Some ( a) , Some ( b) ) => Ok ( Reply :: Pair ( a. to_owned ( ) , b. trim ( ) . to_owned ( ) ) ) ,
33
- _ => Err ( ParseError :: BadPair ) ,
34
- }
29
+ let mut splits = s. splitn ( 2 , ':' ) ;
30
+ match ( splits. next ( ) , splits. next ( ) ) {
31
+ ( Some ( a) , Some ( b) ) => Ok ( Reply :: Pair ( a. to_owned ( ) , b. trim ( ) . to_owned ( ) ) ) ,
32
+ _ => Err ( ParseError :: BadPair ) ,
35
33
}
36
34
}
37
35
}
You can’t perform that action at this time.
0 commit comments