Skip to content

Commit aa49926

Browse files
committed
fix: move no_std check out of loop
1 parent 032fca9 commit aa49926

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

crates/rust-analyzer/src/handlers/request.rs

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -836,13 +836,14 @@ pub(crate) fn handle_runnables(
836836
let config = snap.config.runnables();
837837
match cargo_spec {
838838
Some(spec) => {
839+
let is_crate_no_std = snap.analysis.is_crate_no_std(spec.crate_id)?;
839840
for cmd in ["check", "run", "test"] {
840841
if cmd == "run" && spec.target_kind != TargetKind::Bin {
841842
continue;
842843
}
843844
let mut cargo_args =
844845
vec![cmd.to_owned(), "--package".to_owned(), spec.package.clone()];
845-
let all_targets = cmd != "run" && !snap.analysis.is_crate_no_std(spec.crate_id)?;
846+
let all_targets = cmd != "run" && !is_crate_no_std;
846847
if all_targets {
847848
cargo_args.push("--all-targets".to_owned());
848849
}

0 commit comments

Comments
 (0)