mirror of
https://github.com/rust-lang/rust-analyzer.git
synced 2025-10-09 18:02:48 +00:00
Remove unnecessary dep
This commit is contained in:
parent
80f8e474a0
commit
1f1bda2c5a
3 changed files with 8 additions and 26 deletions
|
@ -5,7 +5,6 @@ import { strict as assert } from "assert";
|
|||
|
||||
import { ArtifactReleaseInfo } from "./interfaces";
|
||||
import { downloadFile } from "./download_file";
|
||||
import { throttle } from "throttle-debounce";
|
||||
|
||||
/**
|
||||
* Downloads artifact from given `downloadUrl`.
|
||||
|
@ -38,19 +37,15 @@ export async function downloadArtifact(
|
|||
async (progress, _cancellationToken) => {
|
||||
let lastPrecentage = 0;
|
||||
const filePermissions = 0o755; // (rwx, r_x, r_x)
|
||||
await downloadFile(downloadUrl, installationPath, filePermissions, throttle(
|
||||
200,
|
||||
/* noTrailing: */ true,
|
||||
(readBytes, totalBytes) => {
|
||||
const newPercentage = (readBytes / totalBytes) * 100;
|
||||
progress.report({
|
||||
message: newPercentage.toFixed(0) + "%",
|
||||
increment: newPercentage - lastPrecentage
|
||||
});
|
||||
await downloadFile(downloadUrl, installationPath, filePermissions, (readBytes, totalBytes) => {
|
||||
const newPercentage = (readBytes / totalBytes) * 100;
|
||||
progress.report({
|
||||
message: newPercentage.toFixed(0) + "%",
|
||||
increment: newPercentage - lastPrecentage
|
||||
});
|
||||
|
||||
lastPrecentage = newPercentage;
|
||||
})
|
||||
);
|
||||
lastPrecentage = newPercentage;
|
||||
});
|
||||
}
|
||||
);
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue