File tree Expand file tree Collapse file tree 1 file changed +5
-11
lines changed Expand file tree Collapse file tree 1 file changed +5
-11
lines changed Original file line number Diff line number Diff line change @@ -1042,24 +1042,18 @@ mod tests {
1042
1042
) ;
1043
1043
let ( tx, rx) = oneshot:: channel ( ) ;
1044
1044
let killer = |arg : SpawnArg < Counters > | async move {
1045
- match arg {
1046
- SpawnArg :: Active ( _) => {
1047
- tx. send ( ( ) ) . ok ( ) ;
1048
- panic ! ( "Panic to kill the task" ) ;
1049
- }
1050
- _ => { }
1045
+ if let SpawnArg :: Active ( _) = arg {
1046
+ tx. send ( ( ) ) . ok ( ) ;
1047
+ panic ! ( "Panic to kill the task" ) ;
1051
1048
}
1052
1049
} ;
1053
1050
// spawn a task that kills the entity actor
1054
1051
manager. spawn ( 1 , killer) . await ?;
1055
1052
rx. await . expect ( "Failed to receive kill confirmation" ) ;
1056
1053
let ( tx, rx) = oneshot:: channel ( ) ;
1057
1054
let counter = |arg : SpawnArg < Counters > | async move {
1058
- match arg {
1059
- SpawnArg :: Dead => {
1060
- tx. send ( ( ) ) . ok ( ) ;
1061
- }
1062
- _ => { }
1055
+ if let SpawnArg :: Dead = arg {
1056
+ tx. send ( ( ) ) . ok ( ) ;
1063
1057
}
1064
1058
} ;
1065
1059
// // spawn another task on the - now dead - entity actor
You can’t perform that action at this time.
0 commit comments