Skip to content

Commit 2ae2512

Browse files
committed
if_same_then_else
1 parent c27b6b5 commit 2ae2512

File tree

2 files changed

+7
-9
lines changed

2 files changed

+7
-9
lines changed

Cargo.toml

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -174,7 +174,6 @@ derived_hash_with_manual_eq = "allow"
174174
field_reassign_with_default = "allow"
175175
forget_non_drop = "allow"
176176
format_collect = "allow"
177-
if_same_then_else = "allow"
178177
large_enum_variant = "allow"
179178
match_like_matches_macro = "allow"
180179
match_single_binding = "allow"

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

Lines changed: 7 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1978,14 +1978,13 @@ fn run_rustfmt(
19781978
// approach: if the command name contains a path separator, join it with the workspace root.
19791979
// however, if the path is absolute, joining will result in the absolute path being preserved.
19801980
// as a fallback, rely on $PATH-based discovery.
1981-
let cmd_path =
1982-
if cfg!(windows) && command.contains([std::path::MAIN_SEPARATOR, '/']) {
1983-
spec.workspace_root.join(cmd).into()
1984-
} else if command.contains(std::path::MAIN_SEPARATOR) {
1985-
spec.workspace_root.join(cmd).into()
1986-
} else {
1987-
cmd
1988-
};
1981+
let cmd_path = if command.contains(std::path::MAIN_SEPARATOR)
1982+
|| (cfg!(windows) && command.contains('/'))
1983+
{
1984+
spec.workspace_root.join(cmd).into()
1985+
} else {
1986+
cmd
1987+
};
19891988
process::Command::new(cmd_path)
19901989
}
19911990
None => process::Command::new(cmd),

0 commit comments

Comments
 (0)