Skip to content

Commit fc57339

Browse files
committed
removing unused code
1 parent 299382d commit fc57339

File tree

1 file changed

+6
-13
lines changed

1 file changed

+6
-13
lines changed

editors/code/src/toolchain.ts

Lines changed: 6 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -3,9 +3,7 @@ import * as os from "os";
33
import * as path from "path";
44
import * as readline from "readline";
55
import * as vscode from "vscode";
6-
import { execute, log, memoizeAsync } from "./util";
7-
8-
const TOOLCHAIN_PATTERN = new RegExp(/(.*)\s\(.*\)/);
6+
import {execute, log, memoizeAsync} from "./util";
97

108
interface CompilationArtifact {
119
fileName: string;
@@ -24,7 +22,7 @@ export class Cargo {
2422
readonly rootFolder: string,
2523
readonly output: vscode.OutputChannel,
2624
readonly env: Record<string, string>
27-
) { }
25+
) {}
2826

2927
// Made public for testing purposes
3028
static artifactSpec(args: readonly string[]): ArtifactSpec {
@@ -44,7 +42,7 @@ export class Cargo {
4442
}
4543
}
4644

47-
const result: ArtifactSpec = { cargoArgs: cargoArgs };
45+
const result: ArtifactSpec = {cargoArgs: cargoArgs};
4846
if (cargoArgs[0] === "test" || cargoArgs[0] === "bench") {
4947
// for instance, `crates\rust-analyzer\tests\heavy_tests\main.rs` tests
5048
// produce 2 artifacts: {"kind": "bin"} and {"kind": "test"}
@@ -149,7 +147,7 @@ export class Cargo {
149147

150148
cargo.stderr.on("data", (chunk) => onStderrString(chunk.toString()));
151149

152-
const rl = readline.createInterface({ input: cargo.stdout });
150+
const rl = readline.createInterface({input: cargo.stdout});
153151
rl.on("line", (line) => {
154152
const message = JSON.parse(line);
155153
onStdoutJson(message);
@@ -191,14 +189,14 @@ export async function getSysroot(dir: string): Promise<string> {
191189
const rustcPath = await getPathForExecutable("rustc");
192190

193191
// do not memoize the result because the toolchain may change between runs
194-
return await execute(`${rustcPath} --print sysroot`, { cwd: dir });
192+
return await execute(`${rustcPath} --print sysroot`, {cwd: dir});
195193
}
196194

197195
export async function getRustcId(dir: string): Promise<string> {
198196
const rustcPath = await getPathForExecutable("rustc");
199197

200198
// do not memoize the result because the toolchain may change between runs
201-
const data = await execute(`${rustcPath} -V -v`, { cwd: dir });
199+
const data = await execute(`${rustcPath} -V -v`, {cwd: dir});
202200
const rx = /commit-hash:\s(.*)$/m;
203201

204202
return rx.exec(data)![1];
@@ -219,11 +217,6 @@ export function cargoPath(): Promise<string> {
219217
return getPathForExecutable("cargo");
220218
}
221219

222-
/** Mirrors `toolchain::cargo()` implementation */
223-
export function rustupPath(): Promise<string> {
224-
return getPathForExecutable("rustup");
225-
}
226-
227220
/** Mirrors `toolchain::get_path_for_executable()` implementation */
228221
export const getPathForExecutable = memoizeAsync(
229222
// We apply caching to decrease file-system interactions

0 commit comments

Comments
 (0)