@@ -145,10 +145,19 @@ impl Dev {
145145 }
146146 }
147147
148+ let cargo_features = config
149+ . lock ( )
150+ . unwrap ( )
151+ . as_ref ( )
152+ . unwrap ( )
153+ . build
154+ . features
155+ . clone ( ) ;
156+
148157 let ( child_wait_tx, child_wait_rx) = channel ( ) ;
149158 let child_wait_rx = Arc :: new ( Mutex :: new ( child_wait_rx) ) ;
150159
151- process = self . start_app ( & runner, child_wait_rx. clone ( ) ) ;
160+ process = self . start_app ( & runner, & cargo_features , child_wait_rx. clone ( ) ) ;
152161
153162 let ( tx, rx) = channel ( ) ;
154163
@@ -191,22 +200,34 @@ impl Dev {
191200 break ;
192201 }
193202 }
194- process = self . start_app ( & runner, child_wait_rx. clone ( ) ) ;
203+ process = self . start_app ( & runner, & cargo_features , child_wait_rx. clone ( ) ) ;
195204 }
196205 }
197206 }
198207 }
199208 }
200209
201- fn start_app ( & self , runner : & str , child_wait_rx : Arc < Mutex < Receiver < ( ) > > > ) -> Arc < SharedChild > {
210+ fn start_app (
211+ & self ,
212+ runner : & str ,
213+ features : & Option < Vec < String > > ,
214+ child_wait_rx : Arc < Mutex < Receiver < ( ) > > > ,
215+ ) -> Arc < SharedChild > {
202216 let mut command = Command :: new ( runner) ;
203217 command. args ( & [ "run" , "--no-default-features" ] ) ;
218+
204219 if let Some ( target) = & self . target {
205220 command. args ( & [ "--target" , target] ) ;
206221 }
222+
223+ if let Some ( features) = features {
224+ command. args ( & [ "--features" , & features. join ( "," ) ] ) ;
225+ }
226+
207227 if !self . args . is_empty ( ) {
208228 command. arg ( "--" ) . args ( & self . args ) ;
209229 }
230+
210231 let child =
211232 SharedChild :: spawn ( & mut command) . unwrap_or_else ( |_| panic ! ( "failed to run {}" , runner) ) ;
212233 let child_arc = Arc :: new ( child) ;
0 commit comments