File tree Expand file tree Collapse file tree 1 file changed +7
-7
lines changed Expand file tree Collapse file tree 1 file changed +7
-7
lines changed Original file line number Diff line number Diff line change @@ -229,6 +229,12 @@ impl CargoWorkspace {
229
229
config : & CargoConfig ,
230
230
progress : & dyn Fn ( String ) ,
231
231
) -> Result < cargo_metadata:: Metadata > {
232
+ let target = config
233
+ . target
234
+ . clone ( )
235
+ . or_else ( || cargo_config_build_target ( cargo_toml) )
236
+ . or_else ( || rustc_discover_host_triple ( cargo_toml) ) ;
237
+
232
238
let mut meta = MetadataCommand :: new ( ) ;
233
239
meta. cargo_path ( toolchain:: cargo ( ) ) ;
234
240
meta. manifest_path ( cargo_toml. to_path_buf ( ) ) ;
@@ -245,13 +251,7 @@ impl CargoWorkspace {
245
251
}
246
252
}
247
253
meta. current_dir ( cargo_toml. parent ( ) . as_os_str ( ) ) ;
248
- let target = if let Some ( target) = & config. target {
249
- Some ( target. clone ( ) )
250
- } else if let stdout @ Some ( _) = cargo_config_build_target ( cargo_toml) {
251
- stdout
252
- } else {
253
- rustc_discover_host_triple ( cargo_toml)
254
- } ;
254
+
255
255
if let Some ( target) = target {
256
256
meta. other_options ( vec ! [ String :: from( "--filter-platform" ) , target] ) ;
257
257
}
You can’t perform that action at this time.
0 commit comments