Buttplug sex toy control library

chore: Run 2024 lints on server

Wonder what + use<> does

+12 -12
+1 -1
crates/buttplug_server/src/device/server_device.rs
··· 462 462 /// 463 463 /// This will include connections, disconnections, and notification events from subscribed 464 464 /// endpoints. 465 - pub fn event_stream(&self) -> impl futures::Stream<Item = ServerDeviceEvent> + Send { 465 + pub fn event_stream(&self) -> impl futures::Stream<Item = ServerDeviceEvent> + Send + use<> { 466 466 let identifier = self.identifier.clone(); 467 467 let hardware_stream = convert_broadcast_receiver_to_stream(self.hardware.event_stream()) 468 468 .filter_map(move |hardware_event| {
+1 -1
crates/buttplug_server/src/device/server_device_manager.rs
··· 175 175 } 176 176 177 177 impl ServerDeviceManager { 178 - pub fn event_stream(&self) -> impl Stream<Item = ButtplugServerMessageV4> { 178 + pub fn event_stream(&self) -> impl Stream<Item = ButtplugServerMessageV4> + use<> { 179 179 // Unlike the client API, we can expect anyone using the server to pin this 180 180 // themselves. 181 181 convert_broadcast_receiver_to_stream(self.output_sender.subscribe())
+3 -3
crates/buttplug_server/src/device/server_device_manager_event_loop.rs
··· 276 276 // address), consider it disconnected and eject it from the map. This 277 277 // should also trigger a disconnect event before our new DeviceAdded 278 278 // message goes out, so timing matters here. 279 - if let Some((_, old_device)) = self.device_map.remove(&device_index) { 279 + match self.device_map.remove(&device_index) { Some((_, old_device)) => { 280 280 info!("Device map contains key {}.", device_index); 281 281 // After removing the device from the array, manually disconnect it to 282 282 // make sure the event is thrown. ··· 285 285 // anything with it, but should at least log it. 286 286 error!("Error during index collision disconnect: {:?}", err); 287 287 } 288 - } else { 288 + } _ => { 289 289 info!("Device map does not contain key {}.", device_index); 290 - } 290 + }} 291 291 292 292 // Create event loop for forwarding device events into our selector. 293 293 let event_listener = device.event_stream();
+5 -5
crates/buttplug_server/src/ping_timer.rs
··· 103 103 } 104 104 } 105 105 106 - pub fn ping_timeout_waiter(&self) -> impl Future<Output = ()> { 106 + pub fn ping_timeout_waiter(&self) -> impl Future<Output = ()> + use<> { 107 107 let notify = self.ping_timeout_notifier.clone(); 108 108 async move { 109 109 notify.notified().await; 110 110 } 111 111 } 112 112 113 - fn send_ping_msg(&self, msg: PingMessage) -> impl Future<Output = ()> { 113 + fn send_ping_msg(&self, msg: PingMessage) -> impl Future<Output = ()> + use<> { 114 114 let ping_msg_sender = self.ping_msg_sender.clone(); 115 115 let max_ping_time = self.max_ping_time; 116 116 async move { ··· 123 123 } 124 124 } 125 125 126 - pub fn start_ping_timer(&self) -> impl Future<Output = ()> { 126 + pub fn start_ping_timer(&self) -> impl Future<Output = ()> + use<> { 127 127 // If we're starting the timer, clear our status. 128 128 self.pinged_out.store(false, Ordering::Relaxed); 129 129 self.send_ping_msg(PingMessage::StartTimer) 130 130 } 131 131 132 - pub fn stop_ping_timer(&self) -> impl Future<Output = ()> { 132 + pub fn stop_ping_timer(&self) -> impl Future<Output = ()> + use<> { 133 133 self.send_ping_msg(PingMessage::StopTimer) 134 134 } 135 135 136 - pub fn update_ping_time(&self) -> impl Future<Output = ()> { 136 + pub fn update_ping_time(&self) -> impl Future<Output = ()> + use<> { 137 137 self.send_ping_msg(PingMessage::Ping) 138 138 } 139 139
+2 -2
crates/buttplug_server/src/server.rs
··· 119 119 /// Retreive an async stream of ButtplugServerMessages. This is how the server sends out 120 120 /// non-query-related updates to the system, including information on devices being added/removed, 121 121 /// client disconnection, etc... 122 - pub fn event_stream(&self) -> impl Stream<Item = ButtplugServerMessageVariant> { 122 + pub fn event_stream(&self) -> impl Stream<Item = ButtplugServerMessageVariant> + use<> { 123 123 let spec_version = self.spec_version.clone(); 124 124 let converter = ButtplugServerMessageConverter::new(None); 125 125 self.server_version_event_stream().map(move |m| { ··· 138 138 /// Retreive an async stream of ButtplugServerMessages, always at the latest available message 139 139 /// spec. This is how the server sends out non-query-related updates to the system, including 140 140 /// information on devices being added/removed, client disconnection, etc... 141 - pub fn server_version_event_stream(&self) -> impl Stream<Item = ButtplugServerMessageV4> { 141 + pub fn server_version_event_stream(&self) -> impl Stream<Item = ButtplugServerMessageV4> + use<> { 142 142 // Unlike the client API, we can expect anyone using the server to pin this 143 143 // themselves. 144 144 let server_receiver = convert_broadcast_receiver_to_stream(self.output_sender.subscribe());