@@ -4,17 +4,30 @@ use getset::{CopyGetters, Getters};
44use buttplug_core:: {
55 errors:: { ButtplugDeviceError , ButtplugError , ButtplugMessageError } ,
66 message:: {
7- ButtplugDeviceMessageNameV4 , ButtplugServerMessageV4 , DeviceFeature , DeviceFeatureOutputLimits ,
8- InputCmdV4 , InputCommandType , InputType , InputTypeReading , OutputCmdV4 , OutputCommand ,
9- OutputPositionWithDuration , OutputType , OutputValue ,
7+ ButtplugDeviceMessageNameV4 ,
8+ ButtplugServerMessageV4 ,
9+ DeviceFeature ,
10+ DeviceFeatureOutputLimits ,
11+ InputCmdV4 ,
12+ InputCommandType ,
13+ InputType ,
14+ InputTypeReading ,
15+ OutputCmdV4 ,
16+ OutputCommand ,
17+ OutputPositionWithDuration ,
18+ OutputType ,
19+ OutputValue ,
1020 } ,
1121} ;
1222
1323use super :: ClientDeviceOutputCommand ;
1424
1525use crate :: {
16- ButtplugClientError , ButtplugClientMessageSender , ButtplugClientResultFuture ,
17- create_boxed_future_client_error, device:: ClientDeviceCommandValue ,
26+ ButtplugClientError ,
27+ ButtplugClientMessageSender ,
28+ ButtplugClientResultFuture ,
29+ create_boxed_future_client_error,
30+ device:: ClientDeviceCommandValue ,
1831} ;
1932
2033#[ derive( Getters , CopyGetters , Clone ) ]
@@ -203,9 +216,7 @@ impl ClientDeviceFeature {
203216 pub fn subscribe_sensor ( & self , sensor_type : InputType ) -> ButtplugClientResultFuture {
204217 if let Some ( sensor_map) = self . feature . input ( )
205218 && let Some ( sensor) = sensor_map. get ( sensor_type)
206- && sensor
207- . command ( )
208- . contains ( & InputCommandType :: Subscribe )
219+ && sensor. command ( ) . contains ( & InputCommandType :: Subscribe )
209220 {
210221 let msg = InputCmdV4 :: new (
211222 self . device_index ,
@@ -225,9 +236,7 @@ impl ClientDeviceFeature {
225236 pub fn unsubscribe_sensor ( & self , sensor_type : InputType ) -> ButtplugClientResultFuture {
226237 if let Some ( sensor_map) = self . feature . input ( )
227238 && let Some ( sensor) = sensor_map. get ( sensor_type)
228- && sensor
229- . command ( )
230- . contains ( & InputCommandType :: Subscribe )
239+ && sensor. command ( ) . contains ( & InputCommandType :: Subscribe )
231240 {
232241 let msg = InputCmdV4 :: new (
233242 self . device_index ,
0 commit comments