File tree Expand file tree Collapse file tree 1 file changed +3
-4
lines changed Expand file tree Collapse file tree 1 file changed +3
-4
lines changed Original file line number Diff line number Diff line change 1717use std:: collections:: hash_map:: Entry ;
1818use std:: collections:: { HashMap , HashSet } ;
1919use std:: fs;
20- use std:: mem:: discriminant;
2120use std:: sync:: Arc ;
2221use std:: time:: Duration ;
2322
@@ -261,7 +260,7 @@ impl Extension {
261260 fn move_state ( & mut self ) {
262261 let next_state = self . state . next ( & self . client ) ;
263262 cdebug ! ( SYNC , "Transitioning the state to {:?}" , next_state) ;
264- if discriminant ( & next_state ) == discriminant ( & State :: Full ) {
263+ if let State :: Full = next_state {
265264 let best_hash = match & self . state {
266265 State :: SnapshotHeader ( hash, _) => * hash,
267266 State :: SnapshotBody {
@@ -294,7 +293,7 @@ impl Extension {
294293 }
295294
296295 fn send_status ( & mut self , id : & NodeId ) {
297- if discriminant ( & self . state ) != discriminant ( & State :: Full ) {
296+ if let State :: Full = self . state {
298297 return
299298 }
300299
@@ -314,7 +313,7 @@ impl Extension {
314313 }
315314
316315 fn send_status_broadcast ( & mut self ) {
317- if discriminant ( & self . state ) != discriminant ( & State :: Full ) {
316+ if let State :: Full = self . state {
318317 return
319318 }
320319
You can’t perform that action at this time.
0 commit comments