diff --git a/crates/rust-analyzer/src/handlers/request.rs b/crates/rust-analyzer/src/handlers/request.rs index 1bbde9b295a8..4e1b7f42583d 100644 --- a/crates/rust-analyzer/src/handlers/request.rs +++ b/crates/rust-analyzer/src/handlers/request.rs @@ -2003,9 +2003,9 @@ fn run_rustfmt( // approach: if the command name contains a path seperator, join it with the workspace root. // however, if the path is absolute, joining will result in the absolute path being preserved. // as a fallback, rely on $PATH-based discovery. - let cmd_path = if cfg!(windows) && command.contains(&[std::path::MAIN_SEPARATOR_STR, '/']) { + let cmd_path = if cfg!(windows) && command.contains(&[std::path::MAIN_SEPARATOR, '/']) { spec.workspace_root.join(cmd).into() - } else if command.contains(std::path::MAIN_SEPARATOR_STR) { + } else if command.contains(std::path::MAIN_SEPARATOR) { spec.workspace_root.join(cmd).into() } else { cmd