File tree Expand file tree Collapse file tree 2 files changed +5
-8
lines changed
Expand file tree Collapse file tree 2 files changed +5
-8
lines changed Original file line number Diff line number Diff line change @@ -9,13 +9,13 @@ use kos::{
99 } ,
1010 kos_proto:: { actuator:: * , common:: ActionResult } ,
1111} ;
12+ use prost_types:: { Struct , Value } ;
1213use std:: sync:: mpsc:: { channel, Sender } ;
1314use std:: sync:: Arc ;
1415use std:: thread;
1516use tokio:: runtime:: Runtime ;
1617use tokio:: time:: Duration ;
1718use tracing:: debug;
18- use prost_types:: { Struct , Value } ;
1919pub struct StubActuator {
2020 operations : Arc < OperationsServiceImpl > ,
2121 calibration_tx : Sender < u32 > ,
@@ -129,10 +129,7 @@ impl Actuator for StubActuator {
129129 } ] )
130130 }
131131
132- async fn get_parameters (
133- & self ,
134- actuator_ids : Vec < u32 > ,
135- ) -> Result < Vec < ( u32 , Struct ) > > {
132+ async fn get_parameters ( & self , actuator_ids : Vec < u32 > ) -> Result < Vec < ( u32 , Struct ) > > {
136133 let dummy_struct = Struct {
137134 fields : vec ! [
138135 ( "model" . to_string( ) , Value :: from( "stub" ) ) ,
Original file line number Diff line number Diff line change @@ -116,21 +116,21 @@ impl ActuatorService for ActuatorServiceImpl {
116116 request : Request < ParameterDumpRequest > ,
117117 ) -> Result < Response < ParameterDumpResponse > , Status > {
118118 let ids = request. into_inner ( ) . actuator_ids ;
119-
119+
120120 let results = self
121121 . actuator
122122 . get_parameters ( ids)
123123 . await
124124 . map_err ( |e| Status :: internal ( format ! ( "Failed to dump parameters: {:?}" , e) ) ) ?;
125-
125+
126126 let entries = results
127127 . into_iter ( )
128128 . map ( |( actuator_id, parameters) | ParameterDumpEntry {
129129 actuator_id,
130130 parameters : Some ( parameters) ,
131131 } )
132132 . collect ( ) ;
133-
133+
134134 Ok ( Response :: new ( ParameterDumpResponse { entries } ) )
135135 }
136136}
You can’t perform that action at this time.
0 commit comments