Repository: Rust-SDL2/rust-sdl2 (language: rust)

Issue:
fix sensor_get_data_rate
It doesn't return the expected type, and the "sensors" example fails.


Discussion / hints:

Fix patch:
diff --git a/src/sdl2/controller.rs b/src/sdl2/controller.rs
index 4e658aefd9..508387d387 100644
--- a/src/sdl2/controller.rs
+++ b/src/sdl2/controller.rs
@@ -642,10 +642,7 @@ impl GameController {
     /// Get the data rate (number of events per second) of a game controller sensor.
     #[doc(alias = "SDL_GameControllerGetSensorDataRate")]
     pub fn sensor_get_data_rate(&self, sensor_type: SensorType) -> f32 {
-        let result =
-            unsafe { sys::SDL_GameControllerGetSensorDataRate(self.raw, sensor_type.into()) };
-
-        Ok(result)
+        unsafe { sys::SDL_GameControllerGetSensorDataRate(self.raw, sensor_type.into()) }
     }
 
     /// Get data from a sensor.


Test patch: