@@ -414,27 +414,19 @@ impl Board {
414414 }
415415 }
416416 }
417- return possible_moves. len ( ) ;
417+ possible_moves. len ( )
418418 }
419419
420420 pub fn is_checkmate ( & self ) -> bool {
421421 if !is_getting_checked ( self . board , self . player_turn , self . moves_history . clone ( ) ) {
422422 return false ;
423423 }
424424
425- if self . number_of_authorized_positions ( ) == 0 {
426- return true ;
427- } else {
428- return false ;
429- }
425+ self . number_of_authorized_positions ( ) == 0
430426 }
431427
432428 pub fn is_pat ( & self ) -> bool {
433- if self . number_of_authorized_positions ( ) == 0 {
434- return true ;
435- } else {
436- return false ;
437- }
429+ self . number_of_authorized_positions ( ) == 0
438430 }
439431
440432 // Method to render the board
@@ -862,7 +854,7 @@ mod tests {
862854 ] ;
863855 let board = Board :: new ( custom_board, PieceColor :: White , vec ! [ ] ) ;
864856
865- assert_eq ! ( Board :: is_checkmate( & board) , true ) ;
857+ assert ! ( Board :: is_checkmate( & board) ) ;
866858 }
867859
868860 #[ test]
@@ -906,7 +898,7 @@ mod tests {
906898 ] ;
907899 let board = Board :: new ( custom_board, PieceColor :: White , vec ! [ ] ) ;
908900
909- assert_eq ! ( Board :: is_checkmate( & board) , false ) ;
901+ assert ! ( ! Board :: is_checkmate( & board) ) ;
910902 }
911903
912904 #[ test]
@@ -959,7 +951,7 @@ mod tests {
959951 ] ;
960952 let board = Board :: new ( custom_board, PieceColor :: White , vec ! [ ] ) ;
961953
962- assert_eq ! ( Board :: is_checkmate( & board) , false ) ;
954+ assert ! ( ! Board :: is_checkmate( & board) ) ;
963955 }
964956
965957 #[ test]
@@ -1003,7 +995,7 @@ mod tests {
1003995 ] ;
1004996 let board = Board :: new ( custom_board, PieceColor :: White , vec ! [ ] ) ;
1005997
1006- assert_eq ! ( Board :: is_pat( & board) , true ) ;
998+ assert ! ( Board :: is_pat( & board) ) ;
1007999 }
10081000
10091001 #[ test]
@@ -1047,6 +1039,6 @@ mod tests {
10471039 ] ;
10481040 let board = Board :: new ( custom_board, PieceColor :: White , vec ! [ ] ) ;
10491041
1050- assert_eq ! ( Board :: is_pat( & board) , false ) ;
1042+ assert ! ( ! Board :: is_pat( & board) ) ;
10511043 }
10521044}
0 commit comments