@@ -361,7 +361,7 @@ mod tests {
361361
362362 let mut live_nodes = failure_detector
363363 . live_nodes ( )
364- . map ( |chitchat_id| chitchat_id. node_id . as_str ( ) )
364+ . map ( |chitchat_id| & * chitchat_id. node_id )
365365 . collect :: < Vec < _ > > ( ) ;
366366 live_nodes. sort_unstable ( ) ;
367367 assert_eq ! ( live_nodes, vec![ "node-10001" , "node-10002" , "node-10003" ] ) ;
@@ -374,7 +374,7 @@ mod tests {
374374 }
375375 let mut dead_nodes = failure_detector
376376 . dead_nodes ( )
377- . map ( |chitchat_id| chitchat_id. node_id . as_str ( ) )
377+ . map ( |chitchat_id| & * chitchat_id. node_id )
378378 . collect :: < Vec < _ > > ( ) ;
379379 dead_nodes. sort_unstable ( ) ;
380380 assert_eq ! ( dead_nodes, vec![ "node-10001" , "node-10002" , "node-10003" ] ) ;
@@ -386,20 +386,20 @@ mod tests {
386386 assert_eq ! (
387387 failure_detector
388388 . live_nodes( )
389- . map( |chitchat_id| chitchat_id. node_id. as_str ( ) )
389+ . map( |chitchat_id| & * chitchat_id. node_id)
390390 . collect:: <Vec <_>>( ) ,
391391 Vec :: <& str >:: new( )
392392 ) ;
393393 assert_eq ! (
394394 failure_detector
395395 . dead_nodes( )
396- . map( |chitchat_id| chitchat_id. node_id. as_str ( ) )
396+ . map( |chitchat_id| & * chitchat_id. node_id)
397397 . collect:: <Vec <_>>( ) ,
398398 Vec :: <& str >:: new( )
399399 ) ;
400400 let mut removed_nodes = garbage_collected_nodes
401401 . iter ( )
402- . map ( |chitchat_id| chitchat_id. node_id . as_str ( ) )
402+ . map ( |chitchat_id| & * chitchat_id. node_id )
403403 . collect :: < Vec < _ > > ( ) ;
404404 removed_nodes. sort_unstable ( ) ;
405405 assert_eq ! (
@@ -426,7 +426,7 @@ mod tests {
426426 assert_eq ! (
427427 failure_detector
428428 . live_nodes( )
429- . map( |chitchat_id| chitchat_id. node_id. as_str ( ) )
429+ . map( |chitchat_id| & * chitchat_id. node_id)
430430 . collect:: <Vec <_>>( ) ,
431431 vec![ "node-10001" ]
432432 ) ;
@@ -437,7 +437,7 @@ mod tests {
437437 assert_eq ! (
438438 failure_detector
439439 . live_nodes( )
440- . map( |chitchat_id| chitchat_id. node_id. as_str ( ) )
440+ . map( |chitchat_id| & * chitchat_id. node_id)
441441 . collect:: <Vec <_>>( ) ,
442442 Vec :: <& str >:: new( )
443443 ) ;
@@ -452,7 +452,7 @@ mod tests {
452452 assert_eq ! (
453453 failure_detector
454454 . live_nodes( )
455- . map( |chitchat_id| chitchat_id. node_id. as_str ( ) )
455+ . map( |chitchat_id| & * chitchat_id. node_id)
456456 . collect:: <Vec <_>>( ) ,
457457 vec![ "node-10001" ]
458458 ) ;
@@ -479,7 +479,7 @@ mod tests {
479479
480480 let live_nodes = failure_detector
481481 . live_nodes ( )
482- . map ( |chitchat_id| chitchat_id. node_id . as_str ( ) )
482+ . map ( |chitchat_id| & * chitchat_id. node_id )
483483 . collect :: < Vec < _ > > ( ) ;
484484 assert_eq ! ( live_nodes, vec![ "node-10001" ] ) ;
485485
@@ -488,7 +488,7 @@ mod tests {
488488
489489 let live_nodes = failure_detector
490490 . live_nodes ( )
491- . map ( |chitchat_id| chitchat_id. node_id . as_str ( ) )
491+ . map ( |chitchat_id| & * chitchat_id. node_id )
492492 . collect :: < Vec < _ > > ( ) ;
493493 assert_eq ! ( live_nodes, Vec :: <& str >:: new( ) ) ;
494494 }
0 commit comments