File tree Expand file tree Collapse file tree 4 files changed +7
-5
lines changed
embedded-service/src/power/policy Expand file tree Collapse file tree 4 files changed +7
-5
lines changed Original file line number Diff line number Diff line change @@ -268,6 +268,8 @@ where
268268 }
269269
270270 let ( event, index) = select_slice ( pin ! ( & mut futures) ) . await ;
271+ // Panic safety: The index is guaranteed to be within bounds since it comes from the select_slice result
272+ #[ allow( clippy:: unwrap_used) ]
271273 let device = self
272274 . devices ( )
273275 . iter_only :: < device:: Device < ' static , D , R > > ( )
Original file line number Diff line number Diff line change @@ -72,12 +72,12 @@ impl DeviceTrait for ExampleDevice<'_> {
7272 }
7373
7474 async fn connect_provider ( & mut self , capability : ProviderPowerCapability ) -> Result < ( ) , Error > {
75- debug ! ( "ExampleDevice connect_provider with {:?}" , capability ) ;
75+ debug ! ( "ExampleDevice connect_provider with {capability :?}" ) ;
7676 Ok ( ( ) )
7777 }
7878
7979 async fn connect_consumer ( & mut self , capability : ConsumerPowerCapability ) -> Result < ( ) , Error > {
80- debug ! ( "ExampleDevice connect_consumer with {:?}" , capability ) ;
80+ debug ! ( "ExampleDevice connect_consumer with {capability :?}" ) ;
8181 Ok ( ( ) )
8282 }
8383}
Original file line number Diff line number Diff line change @@ -6,7 +6,7 @@ use embedded_services::{
66 sync:: Lockable ,
77} ;
88
9- use crate :: { PowerPolicy } ;
9+ use crate :: PowerPolicy ;
1010
1111#[ derive( Debug , Clone , Copy ) ]
1212#[ cfg_attr( feature = "defmt" , derive( defmt:: Format ) ) ]
Original file line number Diff line number Diff line change @@ -85,7 +85,7 @@ pub async fn run_test<F: Future<Output = ()>>(
8585 > = StaticCell :: new ( ) ;
8686 let device0_registration = DEVICE0_REGISTRATION . init ( device:: Device :: new ( DeviceId ( 0 ) , device0, device0_receiver) ) ;
8787
88- policy:: register_device ( device0_registration) . await . unwrap ( ) ;
88+ policy:: register_device ( device0_registration) . unwrap ( ) ;
8989
9090 static DEVICE1_EVENT_CHANNEL : StaticCell < Channel < GlobalRawMutex , RequestData , EVENT_CHANNEL_SIZE > > =
9191 StaticCell :: new ( ) ;
@@ -107,7 +107,7 @@ pub async fn run_test<F: Future<Output = ()>>(
107107 > = StaticCell :: new ( ) ;
108108 let device1_registration = DEVICE1_REGISTRATION . init ( device:: Device :: new ( DeviceId ( 1 ) , device1, device1_receiver) ) ;
109109
110- policy:: register_device ( device1_registration) . await . unwrap ( ) ;
110+ policy:: register_device ( device1_registration) . unwrap ( ) ;
111111
112112 static POWER_POLICY : StaticCell <
113113 PowerPolicy <
You can’t perform that action at this time.
0 commit comments