2 files changed +3
-3
lines changed Original file line number Diff line number Diff line change @@ -79,7 +79,7 @@ impl RunnableKind {
79
79
80
80
impl Runnable {
81
81
// test package::module::testname
82
- pub fn label ( & self , target : Option < String > ) -> String {
82
+ pub fn label ( & self , target : Option < & str > ) -> String {
83
83
match & self . kind {
84
84
RunnableKind :: Test { test_id, .. } => format ! ( "test {test_id}" ) ,
85
85
RunnableKind :: TestMod { path } => format ! ( "test-mod {path}" ) ,
Original file line number Diff line number Diff line change @@ -1364,10 +1364,10 @@ pub(crate) fn runnable(
1364
1364
ide:: RunnableKind :: Bin { .. } => workspace_root. clone ( ) . map ( |it| it. into ( ) ) ,
1365
1365
_ => spec. as_ref ( ) . map ( |it| it. cargo_toml . parent ( ) . into ( ) ) ,
1366
1366
} ;
1367
- let target = spec. as_ref ( ) . map ( |s| s. target . clone ( ) ) ;
1367
+ let target = spec. as_ref ( ) . map ( |s| s. target . as_str ( ) ) ;
1368
+ let label = runnable. label ( target) ;
1368
1369
let ( cargo_args, executable_args) =
1369
1370
CargoTargetSpec :: runnable_args ( snap, spec, & runnable. kind , & runnable. cfg ) ;
1370
- let label = runnable. label ( target) ;
1371
1371
let location = location_link ( snap, None , runnable. nav ) ?;
1372
1372
1373
1373
Ok ( lsp_ext:: Runnable {
0 commit comments