@@ -62,7 +62,10 @@ impl JoystickSubsystem {
62
62
63
63
/// Return the player index of the joystick with index `device_index`.
64
64
#[ doc( alias = "SDL_JoystickGetDevicePlayerIndex" ) ]
65
- pub fn player_index_for_device_id ( & self , device_index : u32 ) -> Result < Option < u32 > , IntegerOrSdlError > {
65
+ pub fn player_index_for_device_id (
66
+ & self ,
67
+ device_index : u32 ,
68
+ ) -> Result < Option < u32 > , IntegerOrSdlError > {
66
69
let device_index = validate_int ( device_index, "device_index" ) ?;
67
70
68
71
let player_index = unsafe { sys:: SDL_JoystickGetDevicePlayerIndex ( device_index) } ;
@@ -77,7 +80,10 @@ impl JoystickSubsystem {
77
80
78
81
/// Return the instance ID of the joystick with player index `player_index`.
79
82
#[ doc( alias = "SDL_JoystickFromPlayerIndex" ) ]
80
- pub fn instance_id_for_player_index ( & self , player_index : u32 ) -> Result < Option < u32 > , IntegerOrSdlError > {
83
+ pub fn instance_id_for_player_index (
84
+ & self ,
85
+ player_index : u32 ,
86
+ ) -> Result < Option < u32 > , IntegerOrSdlError > {
81
87
let player_index = validate_int ( player_index, "player_index" ) ?;
82
88
83
89
let joystick = unsafe { sys:: SDL_JoystickFromPlayerIndex ( player_index) } ;
@@ -86,7 +92,7 @@ impl JoystickSubsystem {
86
92
Ok ( None )
87
93
} else {
88
94
let result = unsafe { sys:: SDL_JoystickInstanceID ( joystick) } ;
89
-
95
+
90
96
if result < 0 {
91
97
// Should only fail if the joystick is NULL.
92
98
panic ! ( "{}" , get_error( ) )
@@ -537,7 +543,7 @@ impl Joystick {
537
543
pub fn get_player_index ( & self ) -> Option < u32 > {
538
544
let player_index = unsafe { sys:: SDL_JoystickGetPlayerIndex ( self . raw ) } ;
539
545
540
- // if index is -1 (or less than 0), joystick has no player
546
+ // if index is -1 (or less than 0), joystick has no player
541
547
if player_index < 0 {
542
548
None
543
549
} else {
0 commit comments