File tree Expand file tree Collapse file tree 2 files changed +4
-4
lines changed Expand file tree Collapse file tree 2 files changed +4
-4
lines changed Original file line number Diff line number Diff line change @@ -250,7 +250,7 @@ impl ProjectWorkspace {
250
250
251
251
pub fn to_crate_graph (
252
252
& self ,
253
- target : Option < & String > ,
253
+ target : Option < & str > ,
254
254
extern_source_roots : & FxHashMap < PathBuf , ExternSourceId > ,
255
255
proc_macro_client : & ProcMacroClient ,
256
256
load : & mut dyn FnMut ( & Path ) -> Option < FileId > ,
@@ -560,7 +560,7 @@ impl ProjectWorkspace {
560
560
}
561
561
}
562
562
563
- fn get_rustc_cfg_options ( target : Option < & String > ) -> CfgOptions {
563
+ fn get_rustc_cfg_options ( target : Option < & str > ) -> CfgOptions {
564
564
let mut cfg_options = CfgOptions :: default ( ) ;
565
565
566
566
// Some nightly-only cfgs, which are required for stdlib
@@ -578,7 +578,7 @@ fn get_rustc_cfg_options(target: Option<&String>) -> CfgOptions {
578
578
let mut cmd = Command :: new ( ra_toolchain:: rustc ( ) ) ;
579
579
cmd. args ( & [ "--print" , "cfg" , "-O" ] ) ;
580
580
if let Some ( target) = target {
581
- cmd. args ( & [ "--target" , target. as_str ( ) ] ) ;
581
+ cmd. args ( & [ "--target" , target] ) ;
582
582
}
583
583
let output = output ( cmd) ?;
584
584
Ok ( String :: from_utf8 ( output. stdout ) ?)
Original file line number Diff line number Diff line change @@ -160,7 +160,7 @@ impl GlobalState {
160
160
} ;
161
161
for ws in workspaces. iter ( ) {
162
162
crate_graph. extend ( ws. to_crate_graph (
163
- config. cargo . target . as_ref ( ) ,
163
+ config. cargo . target . as_deref ( ) ,
164
164
& extern_source_roots,
165
165
& proc_macro_client,
166
166
& mut load,
You can’t perform that action at this time.
0 commit comments